龙空技术网

HTML中button标签点击实现页面跳转的三种方法

前端王小明 308

前言:

今天你们对“html的跳转标签”大致比较注重,大家都想要剖析一些“html的跳转标签”的相关文章。那么小编在网摘上搜集了一些关于“html的跳转标签””的相关文章,希望兄弟们能喜欢,看官们快快来学习一下吧!

方法1:使用onclick事件

<input type="button" value="按钮"onclick="javascrtpt:window.location.href=''" />

或者直接使用button标签

<button onclick="window.location.href = ''">百度</button>

方法2:在button标签外套一个a标签

<a href=""> <button>百度</button></a>

或使用

<a href=""><input type="button" value='百度'></a>

方法3:使用JavaScript函数

<script>function jump(){ window.location.href="";}</script><input type="button" value="百度" onclick=javascrtpt:jump() />// 或者<input type="button" value="百度" onclick="jump()" />// 或者<button onclick="jump()">百度</button>

标签: #html的跳转标签