'width' Example : width « CSS Attributes and Javascript Style Properties « HTML CSS Reference






'width' Example

    
<html>
<body>
<img id="myImg" 
     src="http://www.java2s.com/style/logo.png" 
     width="132">
<br>
<input type="button" value="Shrink image" onclick="myImg.style.width='20'">
<input type="button" value="Restore image" onclick="myImg.style.width='132'">
</body>
</html>

    
      
      








Related examples in the same category

1.'width' Syntax and Note
2.'width' Possible Values
3.'width' is applied to