Home > Software engineering >  Rotation in Javascript
Rotation in Javascript

Time:12-31

I want to make a button in JavaScript that rotates 90 degrees when the method is clicked. what should I do? I wanted to do this with css but it didn't work. Please tell me how to do this with JS? (I know I'm very noob:/)

CodePudding user response:

document.getElementById("myDIV").style.transform = "rotate(7deg)";

CodePudding user response:

Try this for rotation

document.querySelector("#img").style.transform = "rotate(90deg)";

  • Related