⊗jqSeLP 71 of 113 menu

The length property in jQuery

To find out the number of elements in a set, use the length property.

For example, we have the following HTML code:

<p>text</p> <p>text</p> <div>text</div> <p>text</p> <p>text</p> <div>text</div>

Let's find out the number of paragraphs and output it to the console:

let num = $('p').length; console.log(num);

Get the number of elements li.

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