Click to See Complete Forum and Search --> : Image Height and Width Help


chrisjmeagher
07-21-2003, 10:13 AM
Hi. I'm fairly new to JavaScript, so perhaps this question may seem trivial. Is there a way to get the height and width of an image using JavaScript? Do I need to worry about preloading it? What I eventually want to do is create some script to write the <IMG> tags for several pictures, complete with HEIGHT and WIDTH properties. Any help would me much appreciated!

Khalid Ali
07-21-2003, 11:10 AM
yes get reference to the image

and then
img.width or img.height