]> source.dussan.org Git - jquery.git/commitdiff
Attributes: fix toggleClass(boolean) in ie6/7
authorTimmy Willison <timmywillisn@gmail.com>
Thu, 7 Jan 2016 19:17:00 +0000 (14:17 -0500)
committerTimmy Willison <timmywillisn@gmail.com>
Thu, 7 Jan 2016 19:17:00 +0000 (14:17 -0500)
src/attributes/classes.js

index b1539193c467074e82d075c3fc03597760ebb066..a58f5491c4d9ae7aff51dbe14ab0d448f2a9a160 100644 (file)
@@ -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__" ) || ""
+                               );
                        }
                } );
        },