Search code examples
javascriptjquerycssjquery-selectors

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


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

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

...

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


Solution

  • Use :not() to exclude the other class:

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