我在我的應用程序中使用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