Change Language


Follow Navioo On Twitter

Image : HTMLElement

An image in an HTML document.

Platform Support

IE Mozilla Netscape Opera Safari
4.0+ 1.0+ 3.0+ 7.0+ 1.0+

Constructors

Constructor Action IE Mozilla Netscape Opera Safari
Image Constructor() : Image
Creates a new instance of an Image object.
Show Details 4.0+ 1.0+ 3.0+ 7.0+ 1.0+

Image() : Image

Creates a new instance of an Image object.

Returns

Image
Visibility
internal

Inherited Properties

Property Action IE Mozilla Netscape Opera Safari
onclick : Object
Event handler for when a user clicks on the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|Input.onclick|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

ondblclick : Object
Event handler for when a user double-clicks the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

onhelp : Object
Event handler for when a user requests Help.
Show Details 3.0+ no no no no
Availability

Internet Explorer 4

onkeydown : Object
Event handler for when a user presses a key on his or her keyboard.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|HTMLElement.onkeypress

Availability

JavaScript 1.2|HTML 4.0

onkeypress : Object
Event handler for when a user presses and releases a key on his or her keyboard.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event

Availability

JavaScript 1.2|HTML 4.0

onkeyup : Object
Event handler for when a user releases a key on his or her keyboard.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|HTMLElement.onkeydown

Availability

JavaScript 1.2|HTML 4.0

onmousedown : Object
Event handler for when a user clicks the mouse button.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|HTMLElement.onclick|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

onmousemove : Object
Event handler for when a user moves the mouse.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|Window.captureEvents|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

onmouseout : Object
Event handler for when a user moves the mouse off of the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|Link.onmouseout|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

onmouseover : Object
Event handler for when a user moves the mouse over the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|Link.onmouseover

Availability

JavaScript 1.2|HTML 4.0

onmouseup : Object
Event handler for when a user releases the mouse button.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|HTMLElement.onclick|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

all : Array
List of all elements within the current element. Behaves similarly to document.all.
No Details 4.0+ no no 7.0+ no
children : Array
The direct child elements of the current element.
No Details 4.0+ no no no no
className : String
The CSS class that the element belongs to.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
Availability

W3C

document : Object
Reference to the Document object that contains the current element.
No Details 4.0+ no no no no
id : String
Identifier used to assign a unique name to the element.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
Availability

W3C

innerHTML : String
HTML text that the element contains. (Does not include opening and closing tags of the element.)
No Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
innerText : String
Plain text that the element contains. (Does not include opening and closing tags of the element.)
No Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
lang : String
lang attribute of the element.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
Availability

W3C

offsetHeight : Object
Height (in pixels) of the element and its contents.
No Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
offsetLeft : Object
Horizontal position (in pixels) of the element relative to the offsetParent container element.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
See Also

offsetParent

offsetParent : Object
Container element used as a reference for the offsetLeft and offsetTop elements.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
See Also

offsetLeft|offsetTop

offsetTop : Object
Vertical position (in pixels) of the element relative to the offsetParent container element.
No Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
offsetWidth : Object
Width (in pixels) of the element and its contents.
No Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
outerHTML : String
HTML text that the element contains, including its start and end tags.
No Details 4.0+ no no 7.0+ no
outerText : String
Plain text that the element contains, including its start and end tags.
No Details 4.0+ no no 7.0+ no
parentElement : Object
Element that is the direct parent of the current element.
No Details 4.0+ no no no no
sourceIndex : Object
Index of the current element in document.all.
No Details 4.0+ no no no no
style : Object
Inline CSS style attributes for the element.
No Details 4.0+ 1.0+ 4.0+ 7.0+ 1.0+
tagName : String
HTML tag name for the element.
No Details 5.5+ 1.0+ 6.0+ 7.0+ 1.0+
title : String
Title attribute of the HTML tag for the element.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
Availability

W3C

Properties

Property Action IE Mozilla Netscape Opera Safari
static onabort : Function
Event handler for when a user aborts the loading of the image.
Show Details 4.0+ 1.0+ 3.0+ 7.0+ 1.0+
Availability

JavaScript 1.1

static onerror : Function
Event handler for when the loading of the image causes an error.
Show Details 4.0+ 1.0+ 3.0+ 7.0+ 1.0+
Availability

JavaScript 1.1

static onload : Function
Event handler for when the image loads.
Show Details 4.0+ 1.0+ 3.0+ 7.0+ 1.0+
See Also

Event|EventListener|EventTarget

Availability

JavaScript 1.1

border : Number
Width (in pixels) of the image border.
Show Details 4.0+ 1.0+ 3.0+ 7.0+ 1.0+
Availability

W3C

complete : Boolean
Specifies whether the image is completely loaded or not.
No Details 4.0+ 1.0+ 3.0+ 7.0+ 1.0+
height : Number
Height (in pixels) of the image.
Show Details
Availability

W3C

hspace : Number
Amount of horizontal space (in pixels) to insert to the left and the right of the image.
Show Details 4.0+ 1.0+ 3.0+ 7.0+ 1.0+
Availability

W3C

lowsrc : String
URL for an alternate image to display if a user has a low-resolution monitor.
Show Details 4.0+ 1.0+ 3.0+ no no
Availability

W3C

name : String
Name of the image.
Show Details
Availability

W3C

src : String
URL of the image.
Show Details 4.0+ 1.0+ 3.0+ 7.0+ 1.0+
Availability

W3C

vspace : Number
Amount of vertical space (in pixels) to insert at the top and bottom of the image.
Show Details 4.0+ 1.0+ 3.0+ 7.0+ 1.0+
Availability

W3C

width : Number
Width (in pixels) of the image.
Show Details 4.0+ 1.0+ 3.0+ 7.0+ 1.0+
Availability

W3C

Inherited Functions

Method Action IE Mozilla Netscape Opera Safari
contains(Object target) : Boolean
Determines whether the current element contains the target HTML element.
Show Details 4.0+ no no no no

Parameters

Object target The HTML element that the element is to be compared with.

Returns

Boolean
Availability

Internet Explorer 4

getAttribute(String name) : String
Gets the value of the specified attribute.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+

Parameters

String name Name of the attribute.

Returns

String
Availability

handleEvent() : Object
Calls the event handler for the specified event.
Show Details no no 6.0+ no no

Returns

Object
See Also

window.handleEvent|document.handleEvent

insertAdjacentHTML(String where, Object text) : void
Inserts HTML text in the specified location within or next to the element.
Show Details 5.0+ no no 7.0+ no

Parameters

String where Specifies where the HTML text should be inserted.
Object text The HTML text to insert.

Returns

void
insertAdjacentText(String where, Object text) : void
Inserts plain text in the specified location within or next to the element.
Show Details 5.0+ no no 7.0+ no

Parameters

String where Specifies where the text should be inserted.
Object text The plain text to insert.

Returns

void
removeAttribute(String name) : Attribute
Deletes the specified attribute from the element.
Show Details 6.0+ 1.0+ 6.0+ 7.0+ 1.0+

Parameters

String name Name of the attribute to be removed.

Returns

Attribute
scrollIntoView([Boolean top]) : void
Scrolls the current document so that the top of current element is either at the top of the display area, or the bottom of the element is at the bottom of the display area.
Show Details 4.0+ 1.0+ 7.0+ no no

Parameters

Boolean top (optional)Specify false to align the bottom of the element with the bottom of the display area. Specify true or nothing to align the top of the element with the top of the display area.

Returns

void
setAttribute(String name, Object value) : Object
Sets the specified attribute to the specified value for the element.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+

Parameters

String name Name of the attribute.
Object value Value of the attribute to set.

Returns

Object
Availability

HTML DOM Level 1

Availability

JavaScript 1.1|W3C

text_javascript Navioo_docs

Examples -> Source code Demo online - > image:

Ajax Javascript feed

↑ Grab this Headline Animator