html 点击 跳转页面
第一种:
在 button 标签加上 onclick 属性,使用 window.location.href='url' 进行跳转
<input type="button" name="register" value="注册" onclick="window.location.href='register.jsp'"/>
<input type="button" value="按钮" onclick="javascript:window.location.href='https://blog.youkuaiyun.com/qq_42124842'"/>
第二种:
使用函数进行跳转,在 js 中还是比较常用的
<script>
function jump(){
window.location.href="https://blog.youkuaiyun.com/qq_42124842";
};
</script>
<input type="button" value="我是一个按钮" οnclick=javascrtpt:jump()/>
第三种:
使用 a 标签超链接进行嵌套
<a href="https://blog.youkuaiyun.com/qq_42124842">
<button>跳转</button>
</a>
第四种:
表单 action 定向提交跳转
<form action="xx.html" method="get">
<input type="button" value="按钮">
</from>
泡泡:
网站前端跳转方式 不像微信小程序里面 wx.navigateTo, wx.redirectTo 来的那么直接,不过也还好。