From 41c83f5c016a99b0d3f39d1320799b4c11df22f3 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Thu, 7 Jan 2016 14:17:00 -0500 Subject: Attributes: fix toggleClass(boolean) in ie6/7 --- src/attributes/classes.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/attributes/classes.js b/src/attributes/classes.js index b1539193c..a58f5491c 100644 --- a/src/attributes/classes.js +++ b/src/attributes/classes.js @@ -144,13 +144,11 @@ jQuery.fn.extend( { // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - jQuery._data( this, "__className__" ) || "" - ); - } + jQuery.attr( this, "class", + className || value === false ? + "" : + jQuery._data( this, "__className__" ) || "" + ); } } ); }, -- cgit v1.2.3