Find the width and height of an image with javascript

Find the width and height of the image with javascript.

<script type="text/javascript">
var img_new=new Image();
img_new.src="https://mail.google.com/mail/help/images/logo2.gif";
img_new.onload=function(){
   var jsimg_width=img_new.width; 
   var jsimg_height=img_new.height; 
   var jsimg_fileSize=img_new.fileSize; 
}
</script>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.