<div class="fuu">
...
</div>
<div class="fuu no">
...
</div>
...
除了有.no
类的fuu
之外,如何选择所有的?
发布于 2011-04-05 11:27:04
使用:not()
排除其他类:
$('.fuu:not(.no)')
发布于 2011-04-05 11:35:29
你也可以过滤掉'.no‘类,如下所示:
$('.fuu').not('.no');
发布于 2021-08-04 00:25:55
我无法得到第一个答案,直到我添加了另一组引号。这给了我想要的结果,选择排除第二个类的类。
$(".fuu:not('.no')").hide();
https://stackoverflow.com/questions/5546857
复制相似问题