Javascript examples for DOM HTML Element:Image
Image height Property - Change the height and width of an image to 300px:
<!DOCTYPE html> <html> <body> <img id="myImg" src="http://java2s.com/resources/a.png" width="107" height="98"> <button onclick="myFunction()">Test</button> <script> function myFunction() {//from w w w. j a v a2 s .c o m document.getElementById("myImg").height = "300"; document.getElementById("myImg").width = "300"; } </script> </body> </html>