Use .prop instead of .attr where appropriate
[lhc/web/wiklou.git] / resources / jquery / jquery.tabIndex.js
index 33e0604..062ff7d 100644 (file)
@@ -10,7 +10,7 @@
 $.fn.firstTabIndex = function() {
        var minTabIndex = null;
        $(this).find( '[tabindex]' ).each( function() {
-               var tabIndex = parseInt( $(this).attr( 'tabindex' ), 10 );
+               var tabIndex = parseInt( $(this).prop( 'tabindex' ), 10 );
                // In IE6/IE7 the above jQuery selector returns all elements,
                // becuase it has a default value for tabIndex in IE6/IE7 of 0
                // (rather than null/undefined). Therefore check "> 0" as well.
@@ -35,7 +35,7 @@ $.fn.firstTabIndex = function() {
 $.fn.lastTabIndex = function() {
        var maxTabIndex = null;
        $(this).find( '[tabindex]' ).each( function() {
-               var tabIndex = parseInt( $(this).attr( 'tabindex' ), 10 );
+               var tabIndex = parseInt( $(this).prop( 'tabindex' ), 10 );
                if ( tabIndex > 0 && !isNaN( tabIndex ) ) {
                        // Initial value
                        if ( maxTabIndex === null ) {