Using AND logic in jQuery selectors

Using AND logic in jQuery selectors

Hi guys,

Not sure, but this seams to be a tricky one...

I want to use the selectors to select a certain element, that has two different other elements in it.

For example:

  1. <div class="main">
  2. <div class="search01"></div>
  3. <div class="search02"></div>
  4. </div>
If I would do that:

  1. $("div:has(div.search01, div.search02)")
it would return on both elements, so only one need to match.
So basically the , does OR.
But how can I do AND logic, so that both divs inside needs to match?
Is that even possible?

Thanks in advance!