var buttonlinks=document.getElementsByTagName('button');
for(i=0;i<buttonlinks.length;i++) {
buttonlinks[i].target="_self";
}
我是想遍历每一个button,然后都实现,因为你写的我没怎么看懂,要是像我上边的写法,你看要怎么改呢,谢谢!
for(i=0;i<buttonlinks.length;i++) {
buttonlinks[i].target="_self";
}
我是想遍历每一个button,然后都实现,因为你写的我没怎么看懂,要是像我上边的写法,你看要怎么改呢,谢谢!
<a href="1.htm" target="blank">链接1</a>
<a href="2.htm" target="blank">链接2</a>
location.href = "newUrl";
}
for(i=0;i<buttonlinks.length;i++) {
buttonlinks[i].click(function(){
window.open("1.html");
});
}
<button id="search-btn" class="" type="submit">百度搜索</button>
location.href = 网页
$(function () {
$("button").live("click", function () {
window.open("event.htm");
});
}); <button onclick="javascript:window.open('event.htm')">测试</button>
单个
其次,你又说是好多个button,结果贴出一个根本根本没有存储需要打开的页面地址的button。没有明显特征,如何遍历?下面是一个单独的,供你参考吧
<button id="search-btn" class="" onclick="location.href='http://www.baidu.com'" type="submit">百度搜索</button>
<button></button>