Selector not
The :not selector selects those elements that do not match the given selector. In most cases, to make the code more readable, it is recommended to use the not method.
Syntax
This is how we select elements:
$(':not(selector)');
Example
Let's select only those paragraphs that don't have the class www at the end of the text '!!!':
<p class="www">text</p>
<p class="zzz">text</p>
<p class="www">text</p>
<p>text</p>
$('p:not(.www)').append('!!!');
HTML the code will look like this:
<p class="www">text</p>
<p class="zzz">text!!!</p>
<p class="www">text</p>
<p>text!!!</p>