August 1999
Intermediate to advanced
1488 pages
72h 53m
English
document.all.tags(tag)
The tags() method provides a way to retrieve all HTML elements of a particular tag type from the document.all array. The method returns an array of elements.
Listing 7.52 uses the tags() method to create an array of all the anchor tags in the document. Using dot notation, the name of the first anchor in the temporary array is used to create a link to the top of the page.
<html> <a name="Paint"><h2><u>Paint Colors</u></h2></a> Red<br> Green<br> Blue<br> Orange<br> <hr> <script language="JavaScript"> <!-- Hide //Get all the anchor tags var arrayOfAnchors = document.all.tags("A"); ... |
Read now
Unlock full access