HTML DOM images collection
Document Object
Definition and Usage
The images collection returns an array of all images in the current document.
Syntax
document.images[]
.property
Browser support





All major browsers support the images collection
Example
Example 1
Returns the number of images in the document:
Number of images:
The example above produces the following output:
Number of images: 2
Try it »
Example 2
Returns the first image in the document:
ID of the first image:
The example above produces the following output:
ID of the first image: runoob1
Try it »
Document Object