⊗jqSeNM 73 of 113 menu

The not method in jQuery

The method we will look at in this tutorial is not. This is the method that does the negation.

Let's get all paragraphs not with class www:

$('p').not('.www');

When working with this method, we first get all the paragraphs, and then among them we select paragraphs not with the class www.

In the following example we have paragraphs:

<p class="www">text</p> <p class="www">text</p> <p>text</p> <p>text</p>

Let's find all paragraphs, put the text '!' at the beginning of them, then find paragraphs not with the class www and put the text '?' at the end of them:

$('p').prepend('!').not('.www').append('?');

HTML the code will look like this:

<p class="www">!text</p> <p class="www">!text</p> <p>!text?</p> <p>!text?</p>

Find all li, excluding from the set li with class test.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline