String.link() : link « String « JavaScript Tutorial






Syntax

string.link(URL)

The link() method converts the string to an instance of the tag, setting the HREF attribute to the URL that is passed.

<html>
    <script language="JavaScript">
    <!--
    var myString = new String("The online book!");

    document.write(myString.link('http://www.java2s.com'));

    document.close();

    -->
    </script>
</html>








6.20.link
6.20.1.String.link()