Exercise Set 2

Exercise 6 of 6

Change the dog's rotation when the button is clicked. Use the transform style.

HTML

<button id="changeRotationButton">Change rotation</button>
<img src="/img/dog.png" id="dog">

JavaScript

var changeRotationButton = document.getElementById("changeRotationButton");
var dog = document.getElementById("dog");

changeRotationButton.addEventListener("click", changeRotation);

function changeRotation() {
    // your code will appear here
}

You must be signed in to type your code.

Show your answers to the instructor before moving on.

Last exercise Next topic First exercise