Removing multiple classes (jQuery)
Is there any better way to rewrite this:
$('element').removeClass('class1').removeClass('class2');
Can't use removeClass();
as it would remove ALL classes, which I don't want.
Thanks
$("element").removeClass("class1 class2");
From removeClass()
, the class parameter:
One or more CSS classes to remove from the elements, these are separated by spaces.
$('element').removeClass('class1 class2');
这里是文档。
http://docs.jquery.com/Attributes/removeClass
One or more CSS classes to remove from the elements, these are separated by spaces.
链接地址: http://www.djcxy.com/p/64050.html上一篇: ARM开发和仿真
下一篇: 删除多个类(jQuery)