Creates an HTML anchor that is used as a hypertext target.
|Method of String|
- A string.
anchor method with the
document.writeln methods to programmatically create and display an anchor in a document. Create the anchor with the
anchor method, and then call
write function to display the anchor.
In the syntax, the text string represents the literal text that you want the user to see. The
nameAttribute string represents the
NAME attribute of the A tag.
Anchors created with the
anchor method become elements in the
The following example opens the
msgWindow window and creates an anchor for the table of contents:
var myString="Table of Contents" msgWindow.document.writeln(myString.anchor("contents_anchor"))
The previous example produces the same output as the following HTML:
<A NAME="contents_anchor">Table of Contents</A>