Location replace
<html> <body> <script language="JavaScript"> function function1() { location.replace("http://www.java2s.com"); } </script> <input type="button" value="Replace" onClick="function1();"> </body> </html>