我有一个表格,其中的行看起来像这样
<tr>
<td>xyz</td>
<td>xyz</td>
<td>xyz</td>
<td><span class="label-success">Active</span></td>
<td><a href="#" onclick(my-js-here.js)>change status</a></td>
</tr>
<tr>
<td>xyz</td>
<td>xyz</td>
<td>xyz</td>
<td><span class="label-pending">Active</span></td>
<td><a href="#" onclick(my-js-here.js)>another change status</a></td>
</tr>
当我单击“更改状态”链接时,我希望能够将“标签成功”类更改为“标签失败”
在 my-js-here.js 中,我如何在同一行中引用/挑选它
$(this).parents("tr:first").(this is where I am lost).removeClass('lable-success');
$(this).parents("tr:first").(this is where I am lost).addClass('fail');