JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tr>
<th>Name</th>
</tr>
<tr>
<td>John</td>
</tr>
<tr>
<td>Max</td>
</tr>
</table>
</br></br>
<table>
<tr>
<th>Name</th>
</tr>
<tr>
<td>John</td>
</tr>
</table>
CSS
th,td {
padding: 5px 5px;
}
JavaScript
$('td').parents('tr:contains(John)').hide();
$('tr').parents('tbody').not(':has(td)').after('<tr><td> Perfect!! </td> </tr>');
// How can i resolve the same problem where .hide() is in the place of .remove() ??