Mega Code Archive

 
Categories / JavaScript Tutorial / Location
 

Location href

The href property represents the entire URL string for the current page displayed in the browser. <html>     <head>     <title> Using the href property of the Location object</title>     </head>     <body>     <script language="JavaScript">     <!--     function show(){          document.location.href ="http://www.rntsoft.com";     }     -->     </script>     <form name="form1">     Click the button to set the current location.href value of the following address:     <br>     http://www.rntsoft.com     <br><br>     <input type="button" name="sethref" value="Set href" onClick='show()'>     <br>     </form>     </body>     </html>