From http://www.w3schools.com (Copyright Refsnes Data)

JavaScript link() Method


String Object Reference JavaScript String Object

Definition and Usage

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

Syntax

stringObject.link(url)

Parameter Description
url Required. The URL to link to


Example

Example

Display the text: "Free Web Tutorials!" as a hyperlink:

<script type="text/javascript">

var str="Free Web Tutorials!";
document.write(str.link("http://www.w3schools.com"));

</script>

Try it yourself »


String Object Reference JavaScript String Object

From http://www.w3schools.com (Copyright Refsnes Data)