jQuery select a div with a certain class, that doesn't have another class

Alex picture Alex · Apr 5, 2011 · Viewed 28.7k times · Source
<div class="fuu">
  ...
</div>

<div class="fuu no">
  ...
</div>

...

How can I select all fuu's besides the ones that have the .no class?

Answer

BoltClock picture BoltClock · Apr 5, 2011

Use :not() to exclude the other class:

$('.fuu:not(.no)')