---
title: "How to dynamicaly rotate html element using css or jquery"  
description: "How to dynamicaly rotate html element using css or jquery"  
author: "Anonymous User"  
published: 2013-04-16  
updated: 2013-04-16  
canonical: https://www.mindstick.com/forum/768/how-to-dynamicaly-rotate-html-element-using-css-or-jquery  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# How to dynamicaly rotate html element using css or jquery

Hi Everyone!\
How to dynamicaly [rotate](https://answers.mindstick.com/qa/34548/what-is-rotate-indefinitely) [html](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) element using [css](https://www.mindstick.com/forum/514/background-gradient-ie7-css-problem) or jquery?\
Please help me!\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by Vijay Shukla

Hi John!\
You can try as below\
HTML Code:\
<body> <table cellpadding="15" cellspacing="15"> <tr> <td> <img src="http://www.mindstick.com/Employeesection/Image/Multi_purpose.png" id="imgTag" height="150px" width="150px" border="1" /> </td> </tr> </table> <br/> Rotate: <input type="range" min="-360" max="360" value="0" onchange="rotator(this.value)" /><br /> Rotate image in <span id="span1">Zero deg</span></body>\
JavaScript Code:<script type="text/javascript"> function rotator(value) { document.getElementById('imgTag').style.webkitTransform = "rotate(" + value + "deg)"; document.getElementById('imgTag').style.msTransform = "rotate(" + value + "deg)"; document.getElementById('imgTag').style.MozTransform = "rotate(" + value + "deg)"; document.getElementById('imgTag').style.OTransform = "rotate(" + value + "deg)"; document.getElementById('imgTag').style.transform = "rotate(" + value + "deg)"; document.getElementById('span1').innerHTML = value + " deg"; } </script>\


---

Original Source: https://www.mindstick.com/forum/768/how-to-dynamicaly-rotate-html-element-using-css-or-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
