JSFiddle - React, Tailwind, and code Playground

HTML

<table>
<tbody>
<tr>
<td>Hello</td>
<td>Hello (I want to check this column)</td>
</tr>
<tr>
<td>Hello 2</td>
<td class="active">Hello 2 (this column)</td>
<td class="active">Hello 2 (this column)</td>
</tr>
</tbody>
</table>

JavaScript

var length = $('.active').closest('tbody').find('tr').find('td:eq(1)').filter('.active').length; alert(length);