我有一个需要在特殊场合使用 jQuery 修剪的对象列表。出于意图和目的,假设它看起来像这样:
<div id="container">
<div class="child one">stuff</div>
<div class="child two">stuff</div>
<div class="child three">stuff</div>
<div class="child four">stuff</div>
<div class="child five">stuff</div>
</div>
有没有一种简单的方法(如果需要的话,使用 jQuery,纯 JS).child
在第三个之后删除“每个”?
注意:.one, .two .three
不一定按数字顺序。