link

Creates an HTML hypertext link that requests another URL.

Applies to

String

Syntax

link(hrefAttribute)

Parameters

hrefAttribute

Any string that specifies the HREF attribute of the A tag; it should be a valid URL (relative or absolute).

Description

Use the link method to programmatically create a hypertext link, and then call to the write method display the link in a document.

Example

The following example displays the word "Hyperion" as a hypertext link that returns the user to the Hyperion Web site:

var hotText="Hyperion"
var URL="http://www.hyperion.com"
Console.Write("Click to return to " + hotText.link(URL))

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

Click to return to <A HREF="http://www.hyperion.com">Hyperion</A>

See also

String:anchor