开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜