diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-05-04 11:29:38 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-05-04 11:29:38 -0400 |
commit | 480b88ca37fb3aff4ba043298a8fb419905d3f21 (patch) | |
tree | 6f15e9b60253cddfc64b3b4e60e82389abc8c178 /src/attributes.js | |
parent | 97144424ccb79e251d6df354384fa3e4d5362949 (diff) | |
download | jquery-480b88ca37fb3aff4ba043298a8fb419905d3f21.tar.gz jquery-480b88ca37fb3aff4ba043298a8fb419905d3f21.zip |
Set corresponding property to false when removing boolean attributes. Fixes #9094
Diffstat (limited to 'src/attributes.js')
-rw-r--r-- | src/attributes.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/attributes.js b/src/attributes.js index da63a3334..9fdbbd575 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -369,6 +369,12 @@ jQuery.extend({ jQuery.attr( elem, name, "" ); elem.removeAttributeNode( elem.getAttributeNode( name ) ); } + + // Set corresponding property to false for boolean attributes + name = jQuery.propFix[ name ] || name; + if ( !rinvalidChar.test( name ) && typeof elem[ name ] === "boolean" ) { + elem[ name ] = false; + } } }, |