Method 1: Use the onfocus event of javascript to implement as follows:
Html code
If you introduce the jQuery framework, you can use its event binding mechanism:
Js code
$('a').bind('focus', function(){
if(this.blur){ //If this is supported. blur
this.blur();
}
});
Method 2: Use css style to implement the following :
Css code
a{
blr: expression( this.onFocus=this.close());
} /* Only supports IE, excessive use is inefficient*/
a{
blr: expression(this.onFocus=this.blur()) ;
} /* Only supports IE, excessive use is inefficient*/
a:focus {
-moz-outline-style: none;
} /* IE does not support*/
:focus {
outline: none;
} /* for Firefox */
Method 3: Use tag attributes, only supports IE, the implementation is as follows: Html code
Method 4: HTC implementation is as follows:
Save the following code as .htc Suffixed file
Js code
CSS code
a {behavior:url("htc file")}