gpt4 book ai didi

jquery - 删除多个类 (jQuery)

转载 作者:IT王子 更新时间:2023-10-29 03:23:23 24 4
gpt4 key购买 nike

有没有更好的方法来重写这个:

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

我不能使用 removeClass();,因为它会删除我不想要的所有类。

最佳答案

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

来自 removeClass() ,类参数:

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

关于jquery - 删除多个类 (jQuery),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1485647/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com