Set style by property name : setProperty : Style JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Style » setProperty »

 

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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Style
» setProperty