.removeClass() //removes all classes, as documented
.removeClass(window.nonExistentVariable) // removes nothing
jQuery( this ).removeClass( value.call(this, j, this.className) );
});
}
- if ( (value && typeof value === "string") || value === undefined ) {
+ if ( (value && typeof value === "string") || !arguments.length ) {
removes = ( value || "" ).split( core_rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
ok( !$div.hasClass("x"), "Element with multiple same classes does not escape the wrath of removeClass()" );
});
+test("removeClass(undefined) is a no-op", function() {
+ expect( 1 );
+
+ var $div = jQuery("<div class='base second'></div>");
+ $div.removeClass( undefined );
+
+ ok( $div.hasClass("base") && $div.hasClass("second"), "Element still has classes after removeClass(undefined)" );
+});
+
var testToggleClass = function(valueObj) {
expect( 17 );