html button 点击链接

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title></title>
</head>

<body>
//1.在原来的页面中打开:
<input type="button" onclick="window.location.href('xxx.cn')"> //IE中使用"location.href='a.html'" firefox中使用
<a href="b.html"><input type="button" name="test" value="test" /></a>
//2.打开新的页面:
<input type="button" onclick="window.open('xxx.cn')"> 3.使用script

<script>
function btn_onclick() {
window.location = "home.html";
}
</script>

<button class="ui-btn ui-btn-primary" onclick="btn_onclick()">回首页</button>
</body>

</html>

  

posted @ 2016-09-26 12:36  纵横艳刁蛮情  阅读(470)  评论(0编辑  收藏  举报