How can I select an element with multiple classes in jQuery?
Asked 07 September, 2021
Viewed 2.9K times
  • 52
Votes

I want to select all the elements that have the two classes a and 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.

14 Answer