Javascript examples for DOM HTML Element:Image
Image height Property - Return the height of an image that has been styled with CSS:
<!DOCTYPE html> <html> <body> <img id="myImg" src="http://java2s.com/resources/a.png" style="width:250px;height:300px;"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from www . j a v a2 s . c o m var x = document.getElementById("myImg").height; document.getElementById("demo").innerHTML = x; } </script> </body> </html>