方法1:使用onclick事件

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

  或者直接使用button标签

<button onclick="window.location.href = 'https://www.baidu.com/'">百度</button>

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

<a href="http://www.baidu.com/">
<button>百度</button>
</a>

  或使用

<a href="http://www.baidu.com/"><input type="button" value='百度'></a>

方法3:使用JavaScript函数

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

  

HTML中button标签点击实现页面跳转的更多相关文章

  1. html网页中 点击按钮页面跳转

    在html页面中 实现点击按钮页面跳转.语句如下: <input type="button" value="跳转" onClick="windo ...

  2. Android Listview中Button按钮点击事件冲突解决办法

    今天做项目时,ListView中含有了Button组件,心里一早就知道肯定会有冲突,因为以前就遇到过,并解决过,可惜当时没有记录下来. 今天在做的时候,继续被这个问题郁闷了一把,后来解决后,赶紧来记录 ...

  3. html中<button>标签的type

    HTML的<button>标签的type主要有三种可选值,reset.submit.button. 其中reset为重置按钮,用于清除form表单的数据:submit为提交按钮,点击后会对 ...

  4. layui button按钮点击导致页面重新刷新的解决方案

    网友的解决方法:(我只想说,放屁!!!而且大家都在复制粘贴,浪费时间) 方法一:将button标签更换为input <input class="layui-btn test" ...

  5. js中window对象详解以及页面跳转

    1.window.top.window.location = "index.asp"; 2.window.top.location.href="index.asp&quo ...

  6. ASP.NET中iframe框架点击左边页面链接,右边显示链接页面内容

    首先是主页面main.aspx <body style="background-color: #AFEEEE"> <form id="form1&quo ...

  7. a标签点击,页面自动刷新

    <a href="javascript:void(0)" id="reDiagnosis" class="checkBtn"oncli ...

  8. 小程序中button标签的open-type属性

    open-type (微信开放能力):合法值中的其中之一: getUserInfo  说明:引导用户授权     而获取用户信息,可以从bindgetuserinfo回调中获取到用户信息 而按钮的bi ...

  9. Controller 中Action 返回值类型 及其 页面跳转的用法

        •Controller 中Action 返回值类型 View – 返回  ViewResult,相当于返回一个View 页面. -------------------------------- ...

随机推荐

  1. Selenium 定位一组元素

    到目前为止,我们已经知道了怎么去定位一个元素,有时候我们需要获取页面上的多个元素,该怎么办呢?难道还一个一个地去定位,那也太lower了吧. webdriver提供了定位一组元素的方法,跟前面讲的那八 ...

  2. (53)LINUX应用编程和网络编程之八Linux网络基础

    3.8.1.网络通信概述 3.8.1.1.从进程间通信说起:网络域套接字socket,网络通信其实就是位于网络中不同主机上面的2个进程之间的通信. 3.8.1.2.网络通信的层次 (1)硬件部分:网卡 ...

  3. prometheus-pushgateway安装

    背景 当prometheus的server与target不在同一网段网络不通,无法直接拉取target数据,需要使用pushgateway作为数据中转点. 弊端 将多个节点数据汇总到 pushgate ...

  4. Linux小记 -- apt-get install build-essential和yum groupinstall "Development Tools"

    Ubuntu的apt install build-essential 作用:配置Debian系统编译环境,就是下载安装支持编译Debian包的依赖/包,比如gcc等. 直接执行 #apt instal ...

  5. 微信小程序 API 界面(1)

    界面 有关屏幕的api 交互: wx.showToast() 显示消息提示框 参数:object object的属性: title:类型 字符串 提示的内容(文本最多7个汉字) icon:类型 字符串 ...

  6. [论文理解] LFFD: A Light and Fast Face Detector for Edge Devices

    LFFD: A Light and Fast Face Detector for Edge Devices 摘要 从微信推文中得知此人脸识别算法可以在跑2K图片90fps,仔细一看是在RTX2070下 ...

  7. C#通用类库

    http://www.cnblogs.com/feiyangqingyun/archive/2010/12/20/1911630.html

  8. WPF在资源内嵌入字体

    比如需要有这种电子表的字体风格--这种样式叫 :longzhoufeng 字体 在微软的字体有 Quartz MS.TTF或者Quartz Regular.TTF字体.下面以Quartz Regula ...

  9. Linux下去掉^M方法

    由于windows和Linux文件格式不同,windows下文件在Linux下行尾会有^M 去掉^M方法 sed -i ‘s/^M//g' filename #注意:^M的输入方式是 Ctrl + v ...

  10. Cloudera-JDBC-Driver-for-Impala

    Cloudera-JDBC-Driver-for-Impala-Install-Guide-2-5-5.pdf https://github.com/FlowerBirds/flowerbirds.g ...