Grabbing first child <span> from the parent element using jQuery
What jQuery function would I use to grab the closest to the top of 开发者_开发技巧a div <span>
and also the very last in the list as well?
The HTML
<div id="spans">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
the jQuery:
$('#spans span:first,#spans span:last');
Your question requires more explanation but this is a punt at what your looking for.
精彩评论