<table>
<tr class="codesgroupheader"><td>Header1</td></tr>
<tr><td>1</td></tr>
<tr class="codesgroupheader"><td>Header2</td></tr>
<tr><td>2</td></tr>
<tr class="codesgroupheader"><td>Header3</td></tr>
<tr><td>3</td></tr>
<tr class="codesgroupheader"><td>Header4</td></tr>
</table>
And here is the jQuery code
$('.codesgroupheader').not(':last').each(function() {
alert($(this).nextUntil('.codesgroupheader').find('tr').size());
});
But It always returns me zero..
Your code does the following:
If you want to select the number of
<tr>elements with the given class, use:If you want to get the number of
<tr>s between the current and next<tr class=...>, use:For additional reference and usage of the
nextUntilfunction, see the jQuery documentation.