How to find the block which is another block with a specific class?

<tbody><tr>
 <td colspan="7" class="hide-tr name-pnd">PC1</td>
</tr><tr>
 <td colspan="7" class="hide-tr search-click">SECTION</td>
</tr><tr>
<td>TEXT</td>
</tr><tr>
 <td>TEXT TO click</td>
 </tr></tbody>

I need to find the tr which has a block with the class name-pnd. This block is the block which is clicked.
$(this).parent().prev().find('.name-pnd').text()
So it only checks the nearest unit tr, and I need roughly he checked all the tr that are "before" and picked up the nearest. How to do it
April 4th 20 at 00:38
2 answers
April 4th 20 at 00:40
$(this).closest('tr').prevAll('tr:has(.name-pnd)').first()
April 4th 20 at 00:42
Here, have something similar but without tables. don't know the code pen something that did not want to compile them
https://codepen.io/lord-dantes/pen/oNgoWRm

Find more questions by tags jQuery