如何使用jQuery隐藏除当前(单击的行)之外的所有行?
当我单击除当前一行之外的特定行时,我想隐藏所有行。
<table>
@foreach (var item in Model)
{
idValue++;
<tr class="tableRow" id="@idValue">
<td class="master" id="@item.Batch_Seq">
<a href= "#" >@(item.Batch_Name)></a>
</td>
<td>
@(item.Present)
</td>
<td>
@(item.Absent)
</td>
<td>
@(item.HalfDay)
</td>
<td>
@(item.Batch_count)
</td>
</tr>
}
</table>
我试过这样
$('.tableRow').hide();
$(this).closest('tr:not(.tableRow)').hide();
有人可以帮我吗?