Mega Code Archive

 
Categories / JavaScript Tutorial / HTML Tags
 

Area hostname

Syntax document.links[num].hostname The hostname property contains just the hostname that is specified in the URL. This property is a read/write string. <html>     <body>     <form name="question">     <input name="site"            type="radio"            checked            onClick="updateLinks('US')">US<br>     <input name="site"            type="radio"            onClick="updateLinks('EUROPE')">Europe     </form>     <MAP name="rntsoftMap">       <area name="car1"             coords="1,1,48,48"             href="http://www.rntsoft.com"             target="_top">       <area name="car2"             coords="51,1,99,49"             href="http://www.rntsoft.com"             target="_top">     </map>     <img src="http://www.rntsoft.com/style/logo.png" align="top" height="50"   width="100" usemap="#rntsoftMap">     <hr>     <script language="JavaScript">     <!--     function updateLinks(site)     {       if(site=="US")       {         document.links[0].hostname="www.rntsoft.com";         document.links[1].hostname=document.links[0].hostname;       }       if(site=="EUROPE")       {         document.links[0].hostname="www.rntsoft.com";         document.links[1].hostname=document.links[0].hostname;       }     }     -->     </script>     </body>     </html>