Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 3
    What if I want to match it only when each of the element have all the specified classes?
    – IsmailS
    Commented Sep 2, 2011 at 13:01
  • 12
    Al right, I got this one stackoverflow.com/q/1041344/148271. basically I will have to join all the selector for intersection. Like $(".myClass.myOtherClass")
    – IsmailS
    Commented Sep 2, 2011 at 13:03
  • More on CSS grouping: W3C "Grouping".
    – skrounge
    Commented Jun 7, 2013 at 2:34
  • @wal: That comma is necessary also in CSS when pointing to both classes. Without the comma it'd reference to .myOtherClass that is somewhere inside .myClass.
    – geekuality
    Commented Oct 6, 2014 at 12:14
  • this answer doesn't answer the question, this way you're making an OR!!!! not AND!! Commented Nov 27, 2015 at 16:34