]> source.dussan.org Git - jquery.git/commitdiff
Follow w3c standard for setting the common boolean attributes to the same name(select...
authortimmywil <tim.willison@thisismedium.com>
Tue, 19 Apr 2011 21:48:07 +0000 (17:48 -0400)
committertimmywil <tim.willison@thisismedium.com>
Tue, 19 Apr 2011 21:48:07 +0000 (17:48 -0400)
src/attributes.js

index d163469c7f8ad3f33757a15d65a59291ce86beb9..ac832591a363f3979c86ad1a0b7fffa33df62539 100644 (file)
@@ -473,7 +473,10 @@ if ( !jQuery.support.getSetAttribute ) {
 jQuery.each([ "selected", "checked", "readOnly", "disabled" ], function( i, name ) {
        jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
                set: function( elem, value ) {
-                       if ( value === false ) {
+                       if ( value === true ) {
+                               elem.setAttribute( name, name );
+                               return value;
+                       } else if ( value === false ) {
                                jQuery.removeAttr( elem, name );
                                return value;
                        }