Document.images[] (Collection)

An array containing a list of all the images in the document.

Availability:

DOM level - 1
JavaScript - 1.1
JScript - 3.0
Internet Explorer - 4.0
Netscape - 3.0
Opera - 3.0
Property/method value type:ImageArray object
JavaScript syntax:-myDocument.images
HTML syntax:<IMG>

Every image in the document corresponds to an element in this array. There is a one for one relationship between these elements and <IMG> tags.

The MSIE and Netscape browsers each maintain an ImageArray object which is just a special case of the Array object. However, although they both store objects that represent images in that array, those image objects are quite different. For a start in Netscape they are of the class "Image" while in MSIE they are of the class "IMG" named after the HTML tag. Perhaps this is fortunate in that you may be able to detect what kind of object you are operating on if you need to perform complex image management activities. This might change however if browsers become more standards compliant in their object class naming, so it may not be true of all versions of all browsers.

The DOM level 1 specification requires that only those images referenced by <IMG> HTML tags should be included in this list.

Warnings:

See also:Document object, Element.all[], Image object, ImageArray object

Property attributes:

ReadOnly.