<div class="zzz">
<a href="aa.htm">1</a>
<a href="bb.htm">2</a>
<a href="cc.htm">3</a>
</div><style>.zzz a {
//这里怎么设置?
target:_blank; //???
}
</style>
<a href="aa.htm">1</a>
<a href="bb.htm">2</a>
<a href="cc.htm">3</a>
</div><style>.zzz a {
//这里怎么设置?
target:_blank; //???
}
</style>
.zzz a:active {
text:expression(target="_blank");
}可只是ie可以,opera ff chrome 都不认,有通用的方法吗?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<div id="test">
<a href="http://www.baidu.com">12313123</a>
<a href="http://www.baidu.com">12313123</a>
<a href="http://www.baidu.com">12313123</a>
<a href="http://www.baidu.com">12313123</a>
<a href="http://www.baidu.com">12313123</a>
<a href="http://www.baidu.com">12313123</a>
</div>
</br>
<a href="http://www.baidu.com">12313123</a>
<a href="http://www.baidu.com">12313123</a>
<script type="text/javascript">
var div = document.getElementById("test")
var linka = div.getElementsByTagName("a");
for(i=0;i<linka.length;i++){
linka[i].setAttribute("target","_blank");
}
</script>
</body>
</html>
//页面加载完成之后为a标签的href赋值
$(document).ready(function()
{
var a=$('a');
a.setAttribute("target","_blank");
a.href="路径";
}
)
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body>
<div class="zzz">
<a href="#" onclick="window.open('xxx.html','newpage1')">1</a>
<a href="#" onclick="window.open('','newpage2')">2</a>
<a href="#" onclick="window.open('','newpage3')">3</a>
</div>
</body>
</html>