| Availability: |
| ||||||
| Inherits from: | Element object | ||||||
| JavaScript syntax: | IE | myIMG = myDocument.all.anElementID | |||||
| IE | myIMG = myDocument.all.tags("IMG")[anIndex] | ||||||
| IE | myIMG = myDocument.all[aName] | ||||||
| - | myIMG = myDocument.anImageName | ||||||
| - | myIMG = myDocument.getElementById(anElementID) | ||||||
| - | myIMG = myDocument.getElementsByName(aName)[anIndex] | ||||||
| - | myIMG = myDocument.images[anIndex] | ||||||
| - | myIMG = myImageArray[anIndex] | ||||||
| - | myIMG = myDocument.getElementsByTagName("IMG")[anIndex] | ||||||
| HTML syntax: | <IMG> <INPUT TYPE="IMAGE"> | ||||||
| Argument list: | anIndex | A reference to an element in a collection | |||||
| aName | An associative array reference | ||||||
| anElementID | The ID value of an Element object | ||||||
| Object properties: | accessKey, align, alt, border, complete, dataFld, dataFormatAs, dataSrc, defaultValue, dynsrc, fileCreatedDate, fileModifiedDate, fileSize, fileUpdatedDate, height, href, hspace, iccProfile, isMap, longDesc, loop, lowsrc, name, protocol, prototype, readyState, size, src, start, tabIndex, useMap, vspace, width | ||||||
| Object methods: | select() | ||||||
| Event handlers: | onAbort, onAfterUpdate, onBeforeUpdate, onBlur, onChange, onClick, onDataAvailable, onDataSetChanged, onDataSetComplete, onDblClick, onDragStart, onError, onFilterChange, onFocus, onHelp, onKeyDown, onKeyPress, onKeyUp, onLoad, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onResize, onRowEnter, onRowExit, onScroll, onSelectStart | ||||||
<IMG> tags and the objects that represent them are inline elements. Placing them into a document does not create a line break.
Event handling support via properties containing function objects was added to IMG objects at version 1.1 of JavaScript.
The DOM level 1 specification refers to this as an ImageElement object. Netscape implements an Image class with somewhat different properties. By inspecting their DOM attributes, you can see that they are instances of different classes.
| See also: | Element object, Image object, ImageArray object, Input.accessKey |
| Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| accessKey | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| align | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| alt | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| border | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| complete | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
| dataFld | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| dataFormatAs | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| dataSrc | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| defaultValue | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| dynsrc | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| fileCreatedDate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
| fileModifiedDate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
| fileSize | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
| fileUpdatedDate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
| height | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| href | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| hspace | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| iccProfile | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| isMap | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| longDesc | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
| loop | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| lowsrc | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| name | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| protocol | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
| prototype | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
| readyState | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
| size | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| src | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| start | ![]() | 3.0 ![]() | ![]() | 4.0![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
| tabIndex | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| useMap | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| vspace | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| width | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| Event name | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| onAbort | 1.5 ![]() | 3.0![]() | 3.0![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onAfterUpdate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onBeforeUpdate | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onBlur | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| onChange | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onClick | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onDataAvailable | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onDataSetChanged | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onDataSetComplete | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onDblClick | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onDragStart | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onError | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| onFilterChange | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onFocus | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| onHelp | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| onKeyDown | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onKeyPress | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onKeyUp | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onLoad | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| onMouseDown | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onMouseMove | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onMouseOut | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onMouseOver | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onMouseUp | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
| onResize | 1.5 ![]() | 3.0 ![]() | 3.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| onRowEnter | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onRowExit | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onScroll | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| onSelectStart | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| Prev | Home | Next |
| ImageArray.length | Up | IMG.align |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. | ||