mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Do not set boolean attributes to empty string on removal. Fixes #10870. +0 bytes compressed
This commit is contained in:
@@ -464,7 +464,7 @@ test("attr('tabindex', value)", function() {
|
||||
});
|
||||
|
||||
test("removeAttr(String)", function() {
|
||||
expect(9);
|
||||
expect( 10 );
|
||||
var $first;
|
||||
|
||||
equal( jQuery("#mark").removeAttr( "class" ).attr("class"), undefined, "remove class" );
|
||||
@@ -479,6 +479,9 @@ test("removeAttr(String)", function() {
|
||||
jQuery("#text1").prop("readOnly", true).removeAttr("readonly");
|
||||
equal( document.getElementById("text1").readOnly, false, "removeAttr sets boolean properties to false" );
|
||||
|
||||
jQuery("#option2c").removeAttr("selected");
|
||||
equal( jQuery("#option2d").attr("selected"), "selected", "Removing `selected` from an option that is not selected does not remove selected from the currently selected option (#10870)");
|
||||
|
||||
try {
|
||||
$first = jQuery("#first").attr("contenteditable", "true").removeAttr("contenteditable");
|
||||
equal( $first.attr('contenteditable'), undefined, "Remove the contenteditable attribute" );
|
||||
|
||||
Reference in New Issue
Block a user