Document.images

  • Revision slug: DOM/document.images
  • Revision title: document.images
  • Revision id: 29861
  • Created:
  • Creator: George3
  • Is current revision? No
  • Comment /* Specification */ Changed W3C working draft URL to Latest.

Revision Content

{{template.DomRef()}}

Summary

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

Syntax

htmlCollection = document.images 

Example

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

Notes

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

Specification

DOM Level 2 HTML: HTMLDocument.images

{{ wiki.languages( { "fr": "fr/DOM/document.images", "pl": "pl/DOM/document.images" } ) }}

Revision Source

<p>
{{template.DomRef()}}
</p>
<h3 name="Summary"> Summary </h3>
<p><code>document.images</code> returns a collection of the images in the current HTML document. 
</p>
<h3 name="Syntax"> Syntax </h3>
<pre class="eval"><i>htmlCollection</i> = document.images 
</pre>
<h3 name="Example"> Example </h3>
<pre class="eval">var ilist = document.images;
for(var i = 0; i &lt; ilist.length; i++) {
    if(ilist[i] == "banner.gif") {
         // found the banner
    }
}
</pre>
<h3 name="Notes"> Notes </h3>
<p><code>document.images</code> is part of DOM HTML, and it only works for HTML documents.
</p>
<h3 name="Specification"> Specification </h3>
<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-90379117">DOM Level 2 HTML: HTMLDocument.images</a>
</p>{{ wiki.languages( { "fr": "fr/DOM/document.images", "pl": "pl/DOM/document.images" } ) }}
Revert to this revision