其实我比较喜欢第一种方法
1 |
<button onclick="window.location.href='../routeEdit/index.html'" type="button" id="add">新增</button> |
1 2 3 |
<input type="button" onclick='location.href=("index.aspx")' />//在本页面打开 <input type="button" onclick='window.open("bedzhao.aspx")' />//打开新页面 <button onclick="window.location.href='../routeEdit/index.html'" type="button" id="add">新增</button> |
1 2 3 4 5 6 |
<script> function jump(){ window.location.href="http://blog.sina.com.cn/mleavs"; } </script> <input type="button" value="我是一个按钮" οnclick=javascript:jump()> |
1 2 3 |
<a href="https://www.baidu.com/"> <button>点我跳转到度娘!</button> </a> |
1 2 3 |
<form action="xx.html" method="post"> <input type="button" value="按钮"> </form> |
还有其他方法,有些方法一些浏览器可能会不支持。