⊗jqSeSMe 80 of 113 menu

The siblings method in jQuery

Using the method siblings you can find all the neighbors of an element. Let's look at the HTML code:

<p>text</p> <p>text</p> <p id="test">text</p> <p>text</p> <p>text</p>

Then we apply the method siblings:

$('#test').siblings().html('!');

By passing a selector to the method, you can perform additional filtering of neighbors, for example like this:

$(#test).siblings('.zzz').html('!');

Find all neighbors of li with class www.

Find all neighbors of li with class www that (neighbors) have class test.

Find all neighbors of li with class www, but NOT a neighbor 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