Method 1: Use the javascript onfocus eventThe implementation is as follows:
Html code
Copy codeThe Code is as follows:
<A href = "http://www.jb51.net/" onfocus = "this. blur ();"> Design honeycomb </a>
If the jQuery framework is introduced, you can use its event binding mechanism:
Js Code
Copy codeThe Code is as follows:
$ ('A'). bind ('focal ', function (){
If (this. blur) {// if this. blur is supported
This. blur ();
}
});
Method 2: Use the css style to implement the following::
Css code
Copy codeThe Code is as follows:
A {
Blr: expression (this. onFocus = this. close ());
}/* Only supports IE, Which is inefficient when used too much */
A {
Blr: expression (this. onFocus = this. blur ());
}/* Only supports IE, Which is inefficient when used too much */
A: focus {
-Moz-outline-style: none;
}/* IE does not support */
: Focus {
Outline: none;
}/* For Firefox */
Method 3: using label attributes, only Internet Explorer is supported.: Html code
Copy codeThe Code is as follows:
<A href = "http://www.jb51.net/" hidefocus = "true"> design a beehive </a>
Method 4: HTC implements the following:
Save the code as a. htc extension file.
Js Code
Copy codeThe Code is as follows:
<Public: attach event = "onfocus" onevent = "quit ()"/>
<Script language = "javascript">
Function quit (){
This. blur ();
}
</Script>
CSS code
Copy codeThe Code is as follows:
A {behavior: url ("htc file ")}