HTML中button标签点击实现页面跳转
方法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标签点击实现页面跳转的更多相关文章
- html网页中 点击按钮页面跳转
在html页面中 实现点击按钮页面跳转.语句如下: <input type="button" value="跳转" onClick="windo ...
- Android Listview中Button按钮点击事件冲突解决办法
今天做项目时,ListView中含有了Button组件,心里一早就知道肯定会有冲突,因为以前就遇到过,并解决过,可惜当时没有记录下来. 今天在做的时候,继续被这个问题郁闷了一把,后来解决后,赶紧来记录 ...
- html中<button>标签的type
HTML的<button>标签的type主要有三种可选值,reset.submit.button. 其中reset为重置按钮,用于清除form表单的数据:submit为提交按钮,点击后会对 ...
- layui button按钮点击导致页面重新刷新的解决方案
网友的解决方法:(我只想说,放屁!!!而且大家都在复制粘贴,浪费时间) 方法一:将button标签更换为input <input class="layui-btn test" ...
- js中window对象详解以及页面跳转
1.window.top.window.location = "index.asp"; 2.window.top.location.href="index.asp&quo ...
- ASP.NET中iframe框架点击左边页面链接,右边显示链接页面内容
首先是主页面main.aspx <body style="background-color: #AFEEEE"> <form id="form1&quo ...
- a标签点击,页面自动刷新
<a href="javascript:void(0)" id="reDiagnosis" class="checkBtn"oncli ...
- 小程序中button标签的open-type属性
open-type (微信开放能力):合法值中的其中之一: getUserInfo 说明:引导用户授权 而获取用户信息,可以从bindgetuserinfo回调中获取到用户信息 而按钮的bi ...
- Controller 中Action 返回值类型 及其 页面跳转的用法
•Controller 中Action 返回值类型 View – 返回 ViewResult,相当于返回一个View 页面. -------------------------------- ...
随机推荐
- 【leetcode】Exchange Seats
Mary is a teacher in a middle school and she has a table seat storing students' names and their corr ...
- 19. ClustrixDB 执行计划解读
EXPLAIN语句用于显示ClustrixDB查询优化器(也称为Sierra)如何执行INSERT.SELECT.UPDATE和DELETE语句.EXPLAIN的输出有三列: Operation - ...
- POI操作Excel(批量导出数据/下载excel)
目录 1.第一个demo:创建工作簿,创建sheet页,创建单元格 2.创建一个时间格式的单元格 3.遍历工作簿的行和列并获取单元格内容 4.文本提取 5.单元格对齐方式 ...
- Applied Spatiotemporal Data Mining应用时空数据挖掘
Course descriptionWith the continuing advances of geographic information science and geospatialtechn ...
- prometheus-pushgateway安装
背景 当prometheus的server与target不在同一网段网络不通,无法直接拉取target数据,需要使用pushgateway作为数据中转点. 弊端 将多个节点数据汇总到 pushgate ...
- react v16.12 源码阅读环境搭建
搭建后的代码(Keep updated): https://github.com/lirongfei123/read-react 欢迎将源码阅读遇到的问题提到issue 环境搭建思路: 搭建一个web ...
- Java中的可变参数
1.什么是可变参数 可变参数是JDK1.5的新特性,允许一个方式接受任意数量的参数 public static void main(String[] args) { print("a&quo ...
- Vue使用axios请求数据,默认post请求传参是json格式,但后台需要formData格式???
最简单的方式,post请求参数json转formData…代码如下: 使用node的 qs 模块(推荐使用) 就是这么简单,在结合element ui表单一键提交涉及到,希望遇到的同学少走弯路,加油~
- switch 失效
switch 开关失效无法切换,可以关闭,无法开启. 发现问题点 require-table.js 中toggle value的数据类型不是 number 导致 (value ? no : yes ...
- leetcode-easy-array-1 two sum
mycode 33.91% class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: for i ...