Link.hostname : a link : HTML Tags JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » HTML Tags » a link »

 

Link.hostname







The hostname property represents the hostname portion of the link's URL.












<html>
    <head>
    <title> Using the hostname property of the Link object</title>
    </head>
    <body>
    <script language="JavaScript">
    <!--
    function showHostname(){
         alert(document.links[0].hostname);
    }
    -->
    </script>
    Click the button to see the hostname for the URL
    <form name="form1">
    <a href="http://www.navioo.com">www.navioo.com</a>
    <br><br>
    <input type="button" name="host" value="Get Hostname Value" onClick='showHostname()'>
    <br>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo HTML Tags
» a link