Re-size a box with CSS via height and width property - Javascript CSS Style Property

Javascript examples for CSS Style Property:height

Description

Re-size a box with CSS via height and width property

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <script type="text/javascript">
      function changeSize() {//from   ww  w.j a  v  a  2 s  . co  m
        document.getElementById("compman").height="250"
        document.getElementById("compman").width="300"
      }
    
      </script> 
   </head> 
   <body> 
      <img id="compman" src="compman.gif" width="107" height="98"> 
      <br>
      <br> 
      <input type="button" onclick="changeSize()" value="Change size of image">  
   </body>
</html>

Related Tutorials