String.anchor() MethodNameString.anchor() Method---add an HTML anchor to a stringAvailabilityNavigator 2.0, Internet Explorer 3.0 Synopsis
string.anchor(name) Arguments
ReturnsA copy of string, enclosed within <A NAME="name"> and </A> HTML tags. DescriptionString.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. ExampleThe following two JavaScript fragments evaluate to identical strings:
'Chapter 1: Introduction'.anchor('ch01');' '<A NAME="ch01">Chapter 1: Introduction</A>' |
|