Tryit Editor v1.4

<html> <head> <script type="text/javascript"> function currLocation() { alert(window.location); } function newLocation() { window.location="../default.htm"; } </script> </head> <body> <input type="button" onclick="currLocation()" value="Show current URL"> <input type="button" onclick="newLocation()" value="Change URL"> </body> </html> | Your Result:
Edit the code above and click to see the result. | W3Schools.com - Try it yourself