问题:
I want to select all the elements that have the two classes a
and b
. 我想选择具有两个类a
和b
所有元素。
<element class="a b">
So, only the elements that have both classes. 因此,只有具有两个类的元素。
When I use $(".a, .b")
it gives me the union, but I want the intersection. 当我使用$(".a, .b")
它会给我联合,但是我想要交点。
解决方案:
参考一: https://stackoom.com/question/4Mts/如何在jQuery中选择具有多个类的元素参考二: https://oldbug.net/q/4Mts/How-can-I-select-an-element-with-multiple-classes-in-jQuery
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/4467293