HTML DOM Image Object

« Previous Chapter Next Reference »

Image Object

The Image object represents an embedded image.

For each <img> tag in an HTML document, an Image object is created.

Note: images are not technically inserted into an HTML page, images are linked to HTML pages. The <img> tag creates a holding space for the referenced image.

Image Object Properties

W3C: W3C Standard.

Property Description W3C
align Sets or returns the value of the align attribute of an image Yes
alt Sets or returns the value of the alt attribute of an image Yes
border Sets or returns the value of the border attribute of an image Yes
complete Returns whether or not the browser is finished loading an image No
height Sets or returns the value of the height attribute of an image Yes
hspace Sets or returns the value of the hspace attribute of an image Yes
longDesc Sets or returns the value of the longdesc attribute of an image Yes
lowsrc Sets or returns a URL to a low-resolution version of an image No
name Sets or returns the name of an image Yes
src Sets or returns the value of The source attribute of an image Yes
useMap Sets or returns the value of the usemap attribute of an image Yes
vspace Sets or returns the value of the vspace attribute of an image Yes
width Sets or returns the value of the width attribute of an image Yes

Image Object Events

Event The event occurs when... W3C
onabort Loading of an image is interrupted Yes
onerror An error occurs when loading an image Yes
onload An image is finished loading Yes

Standard Properties, Methods, and Events

The Image object also supports the standard properties, methods, and events.


« Previous Chapter Next Reference »

Have Any Suggestion? We Are Waiting To Hear from YOU!

Your Query was successfully sent!