April 16, 2012
Using .hide() instead of .remove()
Question by ptthttp
The output should be like in this demo. The problem is that I need to use .hide() instead of .remove(). Does anyone have any idea to solve it?
$('td').parents('tr:contains(John)').remove();
$('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()
?
<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>