Mega Code Archive

 
Categories / JavaScript Tutorial / Style
 

Set style by property name

< html> <head> <title>Style Example</title> </head> <body> <div id="div1"      style="background-color: red; height: 50px; width: 50px"      onmouseover="this.style.setProperty('background-color', 'blue', '')"      onmouseout="this.style.setProperty('background-color', 'red', '')"></div> </body> </html>