<img>
HTML DOM Image object
Image object
Image objects represent embedded images.
Each time the <img> tag appears, an Image object is created.
Image object attributes
W3C: W3C standard.
Attribute | Description | W3C |
---|---|---|
align | Sets or returns alignment with inline content. | Yes |
alt | Sets or returns alternate text when an 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 blanks to the left and right of the image. | Yes |
longDesc | Sets or returns the URL to the document that contains the image description. | 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 property of the client image map. | Yes |
vspace | Sets or returns blanks at the top and bottom of the image. | Yes |
width | Sets or returns the width of the image. | Yes |
Image object events
Event | Description | W3C |
---|---|---|
onabort | Event handler called when the user abandons the loading of the image. | Yes |
onerror | Event handler called when an error occurs while loading the image. | Yes |
onload | Event handler called when the image has finished loading. | Yes |
Standard Properties and Events
Image objects also support standard properties and events .