Saturday, January 28, 2012

link() Method in JavaScript

The link() method is used to display a string as a hyperlink.
This method returns the string embedded in the <a> tag,
like this: 

<a href="url">string here!!</a>


JavaScript code:

<script language="javascript" type="text/javascript">
    function myUrl() {
        var myString = new String('Home Page');

Html Code:
<button onclick="this.myurl();">Create a link from here! </button>

No comments: