⊗jqDmChCN 46 of 113 menu

Features of working with the hasClass method in jQuery

The last class handling method we should mention is called hasClass. It checks for the presence or absence of the class passed to it as a parameter. If the element has such a class, it will output true, and if it doesn't, it will output false.

Let's say we have the following HTML code:

<p id="test" class="www eee">text</p>

Let's check if the paragraph has the class eee:

alert( $('#test').hasClass('eee') );

Check that at least one of the links has the class www.

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