mirror of
https://github.com/jquery/jquery.git
synced 2026-01-25 18:18:05 -05:00
Follow w3c standard for setting the common boolean attributes to the same name(selected, checked, readOnly, and disabled)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user