这里有张桌子:
<table class="table_dark">
<caption>FLIGHTS</caption>
<tr>
<th>Id</th>
<th>Navigation</th>
<th>Registration to flight</th>
</tr>
<c:forEach var="flight" items="${flights}">
<tr id="tr${flight.id}">
<td>${flight.id}</td>
<td>${flight.navigation}</td>
<td><input type="submit" onclick="registrationClickHandler(event);" value="Register" id="register${flight.id}" class="myButtonStyle1"></td>
</tr>
</c:forEach>
</table>
表图:
当您单击“注册”按钮以隐藏所有其他 tr 时,这是必要的。当您单击关闭按钮( id=closeButton ) 时再次显示。
问题:最好的方法是什么?

正如评论中所建议的那样,可以使用 jquery 和方法解决该任务,
hide并且show: