Image width Example
<html> <body> <script language="JavaScript"> function function1() { alert(document.getElementById("myImage").width); } </script> <img id="myImage" src="http://www.java2s.com/style/logo.png" alt="http://www.java2s.com" width="300" height="300"> <input type="button" value="Image width" onclick="function1();"> </body> </html>