link()

The link() method is used to specify a hyperlink. The URL (see syntax) behaves as an HTML HREF= attribute, which is a component of an anchor () tag.

syntax:

stringNamelink(URL)

EXAMPLE

var newString = new String("Cool Stuff");

document.write(newString.link('http://www.walkthegeek.com') )

The example shows the creation of newString, which contains the text of an anchor. The document.write statement then writes the anchor to the screen, with its HREF attribute set to the URL within the parentheses of the link() method.