Navigator 2.0, Internet Explorer 3.0
string.anchor(name)
The value of the NAME attribute of the HTML <A> tag, i.e., the name of the anchor to be created.
A copy of string, enclosed within <A NAME="name"> and </A> HTML tags.
String.anchor() returns a copy of the string for which it is called, surrounded by <A> and </A> HTML tags. The NAME attribute of the <A> tag is set to the name argument. If the resulting string is appended to an HTML document (with Document.write() for example), it defines an anchor, with a name of name, which can be the target of a hypertext link.
The following two JavaScript fragments evaluate to identical strings:
'Chapter 1: Introduction'.anchor('ch01');' '<A NAME="ch01">Chapter 1: Introduction</A>'