我正在用C#,.NET Framework 4.7和jQuery 3.1.1开发ASP.NET MVC应用程序。隐藏特定行后的所有行
我有一个表的视图:
<table id="myTable">
<tbody>
<tr> ... </tr>
<tr> ... </tr>
<tr> ... </tr>
<tr id="row_x"> ... </tr>
<tr> ... </tr>
<tr> ... </tr>
<tr> ... </tr>
...
我想隐藏的所有行<tr id="row_x"> ... </tr>
下行,但我不知道如何访问这些行。我是否需要为所有人设置一个ID?
我想过用<div>
包围它们,但我认为这不是一个好主意或可能。
你想隐藏所有'td',所以你可以使用'$(“#row_x td”)。hide()'如果你想隐藏'tr'后的所有内容,你应该使用'$ “#row_x”)。nextAll()。hide()' –