日期:2014-05-16  浏览次数:20383 次

button标签如何实现点击按钮在当前页面打开新的网页
通过设置 target="_self" 也没用,好像没有这个选项,貌似!那要怎么设置啊?
------解决方案--------------------
window.open(url)
------解决方案--------------------
你这思路好像有点问题

你用button想打开一个新页面,你得绑定onclick事件中打开

改成a标签就是了。搞这么绕。。。。
<a href="1.htm" target="blank">链接1</a>
<a href="2.htm" target="blank">链接2</a>

------解决方案--------------------
document.getElementById("btn").onclick = function(){
    location.href = "newUrl";

------解决方案--------------------
var buttonlinks=document.getElementsByTagName('button');
  for(i=0;i<buttonlinks.length;i++) {
  buttonlinks[i].click(function(){
window.open("1.html");
});
  }