开发者

Grabbing first child <span> from the parent element using jQuery

开发者 https://www.devze.com 2023-02-17 23:45 出处:网络
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

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

精彩评论

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