我在我的应用程序中使用Jquery V1.11.1。我有一个HTML表看起来像这样:jquery在HTML表中选择标记的第一个父标记
<table id="permissions">
<tr>
<td></td>
<th>Administrators</th>
<th>Moderators</th>
</tr>
<tr>
<th class="aco">controllers/users/display</th>
<td class="permission">Allowed</td>
<td class="permission">Denied</td>
</tr>
</table>
当你点击“允许”或“拒绝”我想选择个标签含有ACO。
我认为这样做,但它does not。 $(this).parent('th').text();
在这种情况下使用Jquery选择TH标签的最佳方式是什么?
谢谢!这对我有效:) – user3772044