document.images : images « Document « JavaScript Tutorial






Syntax

document.images
    document.images[index]

The images property is an array that contains all the objects that appear within the HTML document from using the tag.

The images property length contains the number of items in the array.

The index number ranges from zero to length - 1.

<html>
    <h2>A Circle</h2>
    <img src="http://www.java2s.com/style/logo.png">
    <h2>A Square</h2>
    <img src="http://www.java2s.com/style/logo.png"><br>
    <script language="JavaScript">
    <!--
    for(i=0;i<document.images.length;i++)
    {
      document.write("The source of image object ",(i+1));
      document.write(" is <i><b>",document.images[i].src,"</b></i><br>");
    }
    -->
    </script>
    </html>








14.15.images
14.15.1.document.images
14.15.2.document.images.length