Jump to content

Get Image's Width And Height


Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...