Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at

document.images returns a collection of the images in the current HTML document.


var htmlCollection = document.images;


var ilist = document.images;

for(var i = 0; i < ilist.length; i++) {
    if(ilist[i].src == "banner.gif") {
        // found the banner


document.images.length – property, returns the number of images on the page.

document.images is part of DOM HTML, and it only works for HTML documents.


Specification Status Comment
WHATWG HTML Living Standard
The definition of 'Document.images' in that specification.
Living Standard  
Document Object Model (DOM) Level 2 HTML Specification
The definition of 'Document.images' in that specification.
Recommendation Initial definition.

Document Tags and Contributors

 Last updated by: cvrebert,