Javascript Image Objects

Properties of Image Objects
Property
Description
align
Indicates the alignment of the image, usually “left” or “right.”
alt
The alternative text rendering for the image as set by the alt attribute.
border
The width of the border around the image in pixels.
complete
Non-standard (but well-supported) Boolean indicating whether the image has completed loading.
height
The height of the image in pixels or as a percentage value.
hspace
The horizontal space around the image in pixels.
isMap
Boolean value indicating presence of the ismap attribute, which indicates the image is a server-side image map. The useMap property is used more often today.
longDesc
The value of the (X)HTML longdesc attribute, which provides a more verbose description for the image than the alt attribute.
lowSrc
The URL of the “low source” image as set by the lowsrc attribute. Under early browsers, this is specified by the lowsrc property.
name
The value of the name attribute for the image.
src
The URL of the image.
useMap
The URL of the client-side image map if the <img> tag has a usemap attribute.
vspace
The vertical space in pixels around the image.
width
The width of the image in pixels or as a percentage value.
The traditional Image object also supports onabort, onerror, and onload event handlers. The onabort handler is invoked when the user aborts the loading of the image, usually by clicking the browser’s Stop button. The onerror handler is fired when an error occurs during image loading. The onload handler is, of course, fired once the image has loaded. Under modern browser implementations that support (X)HTML properly, you will also find onmouseover, onmouseout, onclick, and the rest of the core events supported for Image.