anchor

Creates an HTML anchor that is used as a hypertext target.

Applies to

String

Syntax

anchor(nameAttribute)

Parameters

nameAttribute

A string.

Description

Use the anchor method with Console.Write to programmatically create and display an anchor in a document. Create the anchor with the anchor method, and then call write to display the anchor in a document.

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 document.anchors array.

Examples

The following example opens the msgWindow window and creates an anchor for the table of contents:

var myString="Table of Contents"
Write(myString.anchor("contents_anchor"))

The previous example produces the same output as the following HTML:

<A NAME="contents_anchor">Table of Contents</A>

See also

String:link