求教,想根据选中的radio来获取该radio所在那一行里面的所有的td值(每个td里面的值要分别获取出来)
该怎么做呢?
<c:forEach items="${logoutAccountForm.accountList}"
var="logoutList">
<tr height="55" class="table_centent_bj_color_b" >
<td width="100" class=""><span class="radio_wrap">
<input type="radio" id="xh" name="xh" value="" /> <label
for="xh" class="check"></label>
</span></td>
<td width="350" class="" id="accNo"><p>${logoutList.accNo}
</p></td>
<td width="200" class="" id="custName"><p>${logoutList.customer.custName}
</p></td>
<td width="300" class="" id="openBank"><p>${logoutList.openbank}
</p></td>
<td width="250" class="" id="openDate"><p>${logoutList.openDate}
</p></td>
</tr>
</c:forEach>
通多dom关系来获取
$('input[name="xh"]:checked').each(function () {
var tr = $(this).closest('tr'), tds = tr.find('td');
alert(tds.eq(1).text())
alert(tds.eq(2).text())
alert(tds.eq(4).text())
//.....
});
给你的p标签加个id,用js或者jquery一个个取不就行了么
$(obj).parent("tr").find("td"); 这就是 选中的 radio 对象 获取 父 tr 之后找 tr内部的所有td了