Landed cross-browser support for tabIndex, by Scott, closes ticket #3649.
[jquery.git] / src / core.js
index 9347689..d779061 100644 (file)
@@ -1,14 +1,3 @@
-/*
- * jQuery @VERSION - New Wave Javascript
- *
- * Copyright (c) 2008 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date$
- * $Rev$
- */
-
 var 
        // Will speed up references to window, and allows munging its name.
        window = this,
@@ -981,6 +970,13 @@ jQuery.extend({
                                if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
                                        return elem.getAttributeNode( name ).nodeValue;
 
+                               // elem.tabindex doesn't always return the correct value
+                               // 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;
+                               }
+
                                return elem[ name ];
                        }