input button实现页面跳转

<input type="button" value="点击返回主页"  onclick="跳转页面">

1、onclick="window.location.href=' /test/uploadDIY.jsp '"

2、onclick="javascript:window.location.href=' /test/uploadDIY.jsp '" 

3、onclick="location='  https://www.baidu.com '"

其中斜体部分为替换部分,两种写法可以互换

猜你喜欢

转载自blog.csdn.net/weixin_38261616/article/details/80735500
今日推荐