anchor()
The anchor tag is used to display the contents of stringName (see syntax) as a hyperlink, which will be treated as though it is encompassed within the opening and closing HTML (Anchor) tags. The name parameter (see syntax) will be used as the NAME attribute for the anchor tag within the document.
syntax:
stringName.anchor(name)
EXAMPLE
var anchorString = new String("This is an Anchor tag.");
var anchorName = new String("anchorOne");
document.write(anchorString.anchor(anchorName) );
The example first shows the creation of a new string object called anchorString. This will be the text displayed as the anchor when written to the screen. The next string defined is the name of the anchor, which corresponds to the NAME attribute of the Anchor tag. The documnet.write statement then writes the contents of anchorString to the screen, along with some descriptive text. The value in anchorName is not written to the screen - it is what the anchor has been named.
|