August 1999
Intermediate to advanced
1488 pages
72h 53m
English
document.anchors[num].name
The name property holds the name of the anchor and is the way hyperlinks reference the anchor's position. This property is originally set by the NAME attribute in the <a> tag.
Listing 7.2 creates a dictionary of fruit where the heading for each letter of the dictionary is designated as an anchor. At the bottom of the document, the name property of each anchor is used to create the hyperlink text and reference each anchor.
<html> <center> <h1><u>Fruit Dictionary</u></h1> Pick a letter: <a href="#A">A</a>|<a href="#B">B</a>|<a href="#C">C</a> </center> <hr><a name="A"><h4>The ... |
Read now
Unlock full access