Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript link() Method

JavaScript link() Method

String Object Reference JavaScript String object


Definition and Usage

The link() method is used to display a string as a hyperlink.

This method returns the string with an tag added, as shown below:

string

Syntax

string

.link(url)

Parameters Description
url Required. The URL to link to

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the link() method.


Example

Example

Display the string "Free Web Building Tutorials!" as a link:

Try it »


String Object Reference JavaScript String object