`

button按钮链接,及后退、前进、刷新

Go 
阅读更多

有时候需要一个button按钮,点击跳到别的页面,又不想多写js代码,如下代码可以实现:

 

1.如果让本页转向新的页面则用:
<input type=button onclick="window.location.href('连接')">
2.如果需要打开一个新的页面进行转向,则用:
<input type=button onclick="window.open('连接')">

 

 

 

<input type=button value=刷新 onclick="window.location.reload()">

<input type=button value=前进 onclick="window.history.go(1)">

<input type=button value=刷新 onclick="window.history.go(0)">
<input type=button value=后退 onclick="window.history.go(-1)">
<input type=button value=前进 onclick="window.history.forward()">
<input type=button value=后退 onclick="window.history.back()">

后退+刷新
<input type=button value=后退 onclick="window.history.go(-1);window.location.reload()">
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics