method One: Use JavaScript's onfocus event to achieve the following:
HTML code
Copy Code code as follows:
<a href= "http://www.jb51.net/" onfocus= "This.blur ();" > Design Honeycomb </a>
If you introduce the jquery framework, you can leverage its event-binding mechanism:
JS Code
Copy Code code as follows:
$ (' a '). Bind (' Focus ', function () {
if (This.blur) {//If support This.blur
This.blur ();
}
});
method Two: Using CSS style, to achieve the following:
CSS Code
Copy Code code as follows:
a{
Blr:expression (This.onfocus=this.close ());
}/* only supports IE, excessive use efficiency low * *
a{
Blr:expression (This.onfocus=this.blur ());
}/* only supports IE, excessive use efficiency low * *
A:focus {
-moz-outline-style:none;
}/* IE does not support * *
: Focus {
Outline:none;
}/* for Firefox * *
method Three: The use of tag properties, only support IE, to achieve the following: HTML code
Copy Code code as follows:
<a href= "http://www.jb51.net/" hidefocus= "true" > Design honeycomb </a>
Method Four: HTC implementation is as follows:
Save the code as an. HTC suffix file
JS Code
Copy Code code as follows:
<public:attach event= "onfocus" onevent= "Quit ()"/>
<script language= "JavaScript" >
function quit () {
This.blur ();
}
</script>
CSS Code
Copy Code code as follows:
A {behavior:url ("HTC File")}