Cod-nes Posted June 24, 2009 Share Posted June 24, 2009 How can I get the image's width and height in pixels using javascript? Link to comment Share on other sites More sharing options...
jesh Posted June 24, 2009 Share Posted June 24, 2009 You can do it like this: <img src="http://w3schools.invisionzone.com/style_images/6_logo.png" id="myimage" /><script type="text/javascript">var w,h,i;i = document.getElementById("myimage");w = i.width;h = i.height;alert("Width=" + w + "\nHeight=" + h);</script> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.