最简单的就是在链接中加上onfocus="this.blur()",对于批量的可以用以下的方法。
方法一:
<base onclick="if(window.event.srcElement.tagName!='BODY'){window.event.srcElement.blur();}">
<input type="button" value="测试">
<input type="button" value="测试">
<input type="button" value="测试">
<input type="button" value="测试">
<input type="button" value="测试">
<a href='#'>测试</a>
<a href='#'>测试</a>
<a href='#'>测试</a>
<a href='#'>测试</a>
<a href='#'>测试</a>
方法二:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>去除链接虚线</title>
<script>
window.onload=function()
{
for(var i=0; i<document.links.length; i++)
document.links[i].onfocus=function(){this.blur()}
}
</script>
</head>
<body>
<a href="#">此处为测试文字.</a>
</body>
</html>
方法三:
a{
blr:expression(this.onFocus=this.blur()); /* IE Opera */
outline:none; /* FF Opera */
}
a:focus{
-moz-outline-style: none; /* FF */
}