Sunday, May 12, 2019

css - Removing multiple classes (jQuery)




Is there any better way to rewrite this:



$('element').removeClass('class1').removeClass('class2');


I cannot use removeClass(); as it would remove ALL classes, which I don't want.


Answer



$("element").removeClass("class1 class2");



From removeClass(), the class parameter:




One or more CSS classes to remove from
the elements, these are separated by
spaces.



No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...