August 1999
Intermediate to advanced
1488 pages
72h 53m
English
document.images.length
The length property contains the number of objects that are in the images[] array.
The code in Listing 7.139 uses the length property to display the number of images in the HTML document.
<html> <h2>A Circle</h2> <img src="circle.gif"> <h2>A Square</h2> <img src="square.gif"><br> <script language="JavaScript"> <!--Hide //Display the length of the images array. document.write(document.images.length," image objects."); //Hide End ---> </script> </html> |
Read now
Unlock full access