⊗jqSeHM 76 of 113 menu

jQuery has method

If we need to filter a set by elements that have certain descendants, we can use the has method:

For example, let's say we have the following HTML code:

<p>text</p> <p>text</p> <p><b>bold</b> text</p> <p><b>bold</b> text</p>

Let's select only those paragraphs that have the tag b inside and put the text '???' at the end of them:

$('p').has('b').append('???');

Find those li in the set that have a i tag inside and color them red.

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