Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Image Object

HTML DOM Image Object


Image Object

The Image object represents an embedded image.

An Image object is created each time the tag appears.


Image Object Properties

W3C: W3C standard.

property Description W3C
align Sets or returns the alignment of the inline content. Yes
alt Sets or returns the alternate 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 whitespace on the left and right of the image. Yes
longDesc Sets or returns the URL of the document containing the image description. Yes
lowsrc Sets or returns the URL of the 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 for the client-side image map. Yes
vspace Sets or returns the whitespace at the top and bottom of the image. Yes
width Sets or returns the width of the image. Yes

Image Object Events

Events Description W3C
onabort The event handler invoked when the user aborts the loading of the image. Yes
onerror The event handler invoked when an error occurs while loading the image. Yes
onload The event handler invoked when the image has finished loading. Yes

Standard properties and events

The Image object also supports the standard property and Events.