'style' Example : style « Javascript Objects « JavaScript Reference

'style' Example

    
<html>
<body>
<div id="myDiv" style="width:100; height:100;"></div>
<button onclick="myDiv.style.backgroundColor = 'blue';">Change color</button>
</body>
</html>

    
      
      








Related examples in the same category

1.'style' Syntax and Note
2.'style' CSS Attributes and JavaScript Style Properties
3.'style' Microsoft Filters
4.'style' JavaScript Properties
5.'style' JavaScript Methods
6.'style' is applied to