HTML DOM ImageObject


Image Object

The Image object represents an embedded image.

Each time the <img> tag appears, an Image object is created.


Image Object Properties

W3C:W3C Standard.

Property Description W3C
align Sets or returns the alignment with inline content. Yes
alt Sets or returns the alternative text when the image cannot be displayed. Yes
border Sets or returns the border around the image. Yes
complete Returns whether the browser has finished loading the image. No
height Sets or returns the height of the image. Yes
hspace Sets or returns the white space on the left and right sides of the image. Yes
longDesc Sets or returns the URL to a document that contains a description of the image. Yes
lowsrc Sets or returns the URL to a low-resolution version of the image. No
name Sets or returns the name of the image. Yes
src Sets or returns the URL of the image. Yes
useMap Sets or returns the value of the usemap attribute of a client-side image map. Yes
vspace Sets or returns the white space above and below the image. Yes
width Sets or returns the width of the image. Yes

Image Object Events

Event Description W3C
onabort The event handle called when the user aborts the loading of the image. Yes
onerror The event handle called when an error occurs during the loading of the image. Yes
onload The event handle called when the image finishes loading. Yes

Standard Properties and Events

The Image object also supports the standardattributesandevents。

Other Extensions