Copy codeThe Code is as follows:
(Function ($ ){
Var no_ie_pr = function (e ){
Var _ this = e;
Var tabpr = function (e ){
_ This. attr ('tabindex', 1). click (function (){
_ This. focus ();
});
If (! $. Browser. msie ){
_This.css ("outline-style", "none ");
}
}
Var gettag = _ this [0]. tagName. toLowerCase ();
Var oe = ['abbr ', 'acronymm', 'address',' B ', 'bdo', 'Big ', 'blockquote', 'center', 'cite ', 'dd', 'del ', 'dir', 'dfn', 'dl ', 'dt', 'em', 'font', 'form', 'h1 ', 'h2 ', 'h3', 'h4 ', 'h5', 'h6', 'I', 'int', 'img ', 'int', 'kbd ', 'lil', 'menu ', 'ol', 'P', 'pre', 'Q', 's', 'samp', 'small', 'strike ', 'strong ', 'sub', 'up', 'th', 'tr', 'TT', 'U', 'U', 'var'];
If ($. inArray (gettag, oe )! =-1 ){
Tabpr ();
} Else {
If ($. browser. msie ){
Var ce = ['span ', 'div'];
If ($. inArray (gettag, ce )! =-1 ){
// IE is only valid for absolute and fixed positioning elements. The dotted line cannot be eliminated when tabIndex is added.
} Else {
Var ce = ['label', 'gend', 'tbody', 'tfoot', 'thead'];
If ($. inArray (gettag, ce )! =-1 ){
Tabpr ();
}
}
} Else {
Var ce = ['caption ', 'fieldset', 'table', 'td', 'code', 'div ', 'span', 'label', 'legend ', 'tbody', 'tfoot', 'thead'];
If ($. inArray (gettag, ce )! =-1 ){
Tabpr ();
}
}
}
}
$. Fn. oldKeyup = $. fn. keyup;
$. Fn. keyup = function (fn ){
No_ie_pr (this );
$ (This). oldKeyup (fn );
}
$. Fn. oldKeypress = $. fn. keypress;
$. Fn. keypress = function (fn ){
No_ie_pr (this );
$ (This). oldKeypress (fn );
}
$. Fn. oldKeydown = $. fn. keydown;
$. Fn. keydown = function (fn ){
No_ie_pr (this );
$ (This). oldKeydown (fn );
}
}) (JQuery)