X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=61a9bd9f6a406f352ba5310162ea82b121d9d8cf;hb=49d0d5b7a3628947a14028d14ed042746cc6c3e4;hp=c4c3867175a7980b9c00033704aec1f9b2f68427;hpb=f9e0b1ed7a5f252bb58aba9bdfb96653af2b4c1b;p=jquery.git diff --git a/src/core.js b/src/core.js index c4c3867..61a9bd9 100644 --- a/src/core.js +++ b/src/core.js @@ -968,11 +968,15 @@ jQuery.extend({ if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) return elem.getAttributeNode( name ).nodeValue; - // elem.tabindex doesn't always return the correct value + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - if ( name == jQuery.props.tabindex ) { - var attributeNode = elem.getAttributeNode(jQuery.props.tabindex); - return attributeNode && attributeNode.specified && attributeNode.value || undefined; + if ( name == "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + return attributeNode && attributeNode.specified + ? attributeNode.value + : elem.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i) + ? 0 + : undefined; } return elem[ name ];