我试图在表中选中的单选按钮的兄弟上获取 rel 属性:
<table id="table-handing-subjects-content" class="table-content-all">
<tbody>
<tr for="handling-subject0">
<td style="width:10%;">
<input id="handling-subject[0]" type="radio" value="2" name="handling_subject">
</td>
<td style="width:25%;">
<label for="handling-subject[0]"> economics</label>
</td>
<td style="width:15%;">
<label for="handling-subject[0]"> firstyear</label>
</td>
<td style="width:20%;">
<label id="ref-sec-id[0]" for="handling-subject[0]" rel="36"> black</label>
</td>
<td style="width:30%;">
<label for="handling-subject[0]"> asdf,asdf asdf</label>
</td>
</tr>
<tr for="handling-subject1">
<td style="width:10%;">
<input id="handling-subject[1]" type="radio" value="3" name="handling_subject">
</td>
<td style="width:25%;">
<label for="handling-subject[1]"> math</label>
</td>
<td style="width:15%;">
<label for="handling-subject[1]"> firstyear</label>
</td>
<td style="width:20%;">
<label id="ref-sec-id[1]" for="handling-subject[1]" rel="36"> black</label>
</td>
<td style="width:30%;">
<label for="handling-subject[1]"> asdf,asdf asdf</label>
</td>
</tr>
<tr for="handling-subject2">
<td style="width:10%;">
<input id="handling-subject[2]" type="radio" value="3" name="handling_subject">
</td>
<td style="width:25%;">
<label for="handling-subject[2]"> math</label>
</td>
<td style="width:15%;">
<label for="handling-subject[2]"> firstyear</label>
</td>
<td style="width:20%;">
<label id="ref-sec-id[2]" for="handling-subject[2]" rel="32"> level-up</label>
</td>
<td style="width:30%;">
<label for="handling-subject[2]"> asdf,asdf asdf</label>
</td>
</tr>
</tbody>
</table>
我试图用这个来获取选中单选按钮的 id="ref-sec-id" 的标签
$('input[name=handling_subject]:checked').parent().parent().parent().children().find("td:eq(3)").children().attr("rel");
但我想我只得到第一行未选中的单选按钮。请帮助..并提前感谢