jquery - How we get all ids of sibling div? -


the design this

<div id="cat-11">apple<span class='qty'>(12)</span></div> <div id="cat-12">samsung<span class='qty'>(22)</span></div> <div id="cat-13">moto g<span class='qty'>(55)</span></div> <div id="cat-14">google<span class='qty'>(16)</span></div> <div id="cat-15">nokia<span class='qty'>(100)</span></div> 

i have span value of id cat-13. want span value of siblings div? plz assist assist me.

i tried this:

$("#cat-13").sibling().find('span').val(); 

i know return single value unable vaules?

to ids in array may do

var arr = $("#cat-13").siblings().map(function(){ return this.id }).get(); 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -