Mega Code Archive

 
Categories / JavaScript Tutorial / HTML Tags
 

Link host

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