Platform Support
| Mozilla | Chrome | Safari | Opera | IE | Netscape | 1.0+ | 5.0+ | 1.0+ | 4.0+ | 2.0+ | 1.0+ |
|---|
Constructors
| Constructor | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | ||
|---|---|---|---|---|---|---|---|---|---|
|
HTMLImageElement Constructor() : HTMLImageElement
Creates an instance of the HTMLImageElement.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 4.0+ | 2.0+ | 1.0+ | ||
HTMLImageElement() : HTMLImageElementCreates an instance of the HTMLImageElement. Returns
|
|||||||||
Properties
| Property | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape |
|---|---|---|---|---|---|---|---|
|
alt
: String
Specifies the img element's fallback content.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 4.0+ | 2.0+ | 1.0+ |
|
|||||||
|
src
: String
Specifies a valid non-empty URL potentially surrounded by spaces referencing a non-interactive, optionally animated, image
resource that is neither paged nor scripted.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 4.0+ | 2.0+ | 1.0+ |
|
|||||||
|
useMap
: String
Indicates that the image has an associated image map.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 4.0+ | 2.0+ | 1.0+ |
|
|||||||
|
isMap
: Boolean
Indicates by its presence that the element provides access to a server-side image map.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 4.0+ | 2.0+ | 1.0+ |
|
|||||||
|
width
: Number
Specifies the width of the image.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 4.0+ | 2.0+ | 1.0+ |
|
|||||||
|
height
: Number
Specifies the height of the image.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 4.0+ | 2.0+ | 1.0+ |
|
|||||||
|
naturalWidth
: Number
Specifies the intrinsic width of the image.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 4.0+ | 2.0+ | 1.0+ |
|
|||||||
|
naturalHeight
: Number
Specifies the intrinsic height of the image.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 4.0+ | 2.0+ | 1.0+ |
|
|||||||
|
complete
: Boolean
Specifies whether the image was successfully fetched from the source attribute, and is a supported image type.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 4.0+ | 2.0+ | 1.0+ |
|
|||||||
Inherited Functions
| Method | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
getElementsByClassName(String classNames) : NodeList
Returns a NodeList containing all the
Element nodes with the specified classNames. |
Show Details | 1.9+ | 5.0+ | 3.1+ | 9.51+ | no | no | |||||
|
Parameters
Returns
|
||||||||||||
References
Availability
JavaScript 1.2|WhatWG