August 1999
Intermediate to advanced
1488 pages
72h 53m
English
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 <img> tag. The images property has one property of its own, called length, which contains the number of items in the array. The index number ranges from zero to the length of the array minus 1.
The code in Listing 7.138 accesses the source of each image using the images[] array.
<html> <h2>A Circle</h2> <img src="circle.gif"> <h2>A Square</h2> <img src="square.gif"><br> <script language="JavaScript"> <!--Hide //Display the source of the image ... |
Read now
Unlock full access