How to change rotate property of css using javascript? | SoloLearn: Learn to code for FREE!

+2

How to change rotate property of css using javascript?

No need to expalin.. just write.. Suppose you have that on tag <img>. U want to create a button to rotate that image on screen... Create function and so on.. But my question is how to change that... Like . . function prev() { var slider = document.getElementById('slider'); num--; if(num < 0) { num = images.length-1; } ***slider.src = images[num];*** } How write that 3star line for rotate??

3/31/2020 7:02:52 AM

Sohanur Rahman

3 Answers

New Answer

+3

Use the CSS property, "transform:rotate" https://code.sololearn.com/WXkG6FJAiZWP/?ref=app

+2

Sohanur Rahman , What do you mean by "No need to explain.. just write.. " And please post complete code. I can't understand what you really asked here.

+2

🇮🇳Omkar🕉 i meant that... Just write the magic line bro.