好的,我有以下 dom 树:
<div class="daterow">
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
</div>
<br/>
<div class="daterow">
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="class1">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
</div>
<br/>
<div class="daterow">
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
</div>
<br/>
<div class="daterow">
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
<div class="date">TEST CONTENT</div>
</div>
我正在尝试在具有 class1 类的 div 之后计算所有具有日期类的 div,我该如何在 jquery 或 vanilla js 中解决这个问题,这是我到目前为止所拥有的,但我失败了,小提琴: http ://jsfiddle.net/dXGw3/1/