I need to select each $('div span:eq(0)').text() inside $('div#first'). How can I string these two selectors together?
<div id="first">Some stuff to be ignored.</div>
<div>
<div>
<ul>
<li>
<span>Some text</span> <!-- need this -->
<span>Skipped text</span>
</li>
</ul>
</div>
<div>
<ul>
<li>
<span>Some text</span> <!-- and this -->
<span>Skipped text</span>
</li>
</ul>
</div>
<!-- this pattern continues unknown # of times -->
</div>
Try using
liinstead ofdiv.DEMO: http://jsfiddle.net/rFUB8/1/