HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> div{ width: 100px; height: 100px; margin-left: 50px; border: 1px solid black; } </style> </head> <body> <h1>CSS transform Property</h1> <div> Div </div> <button onclick="myFunction()">Click Me</button> <script> var x = document.getElementsByTagName("div")[0]; function myFunction(){ x.style.transform = "rotate(50deg)"; } </script> <p><strong>Note</strong>: Click on the button to rotate the div.</p> </body> </html>
OUTPUT
×

Save as Private