<table>
<tr>
<Td>1</td>
<Td>2</td>
<Td>3</td>
<Td>4</td>
</tr>
</table>
假如我的TR的第二列是复选框,有多行数据。第4列是文字(‘是’或者‘否’),我怎么用JQUERY判断我选择的复选框的那一行的第四列值是什么(可能选中多个复选框)。在线等
<tr>
<Td>1</td>
<Td>2</td>
<Td>3</td>
<Td>4</td>
</tr>
</table>
假如我的TR的第二列是复选框,有多行数据。第4列是文字(‘是’或者‘否’),我怎么用JQUERY判断我选择的复选框的那一行的第四列值是什么(可能选中多个复选框)。在线等
解决方案 »
- JvectorMap 地图显示问题
- 请问主窗口的变量,iframe的页面能调用吗?
- extJS 函数问题
- table 增加一行 表格下移
- 我ajax 了一个页面 想把这个页面放在一个div里 然后 显示 结果显示不出开??
- js中取xml文件节点属性
- 关于javascript日志
- 输入框怎么样控制才能让用户只输入数字和“+”号
- 当前页面的URL是:http://xxx/xxx.nsf/view?openview&count=30&start=1,如何得到count和start的值?
- mongoose怎么populate别的集合的子文档?
- EasyUI dialog动态URL问题?
- jquery.mobile page 刷新的问题 我已经给它跪了....
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type='text/javascript' src='../id.php'></script>
<script type="text/javascript">
$(function(){
$("#abv").click(function(){
$("td :checkbox:checked").each(function(){
alert($(this).attr("value"));
});
});
})
</script>
<input type="button" id="abv" value="测试用按钮"/>
<table border="1" cellspacing="0" cellpadding="0" width="600">
<tr>
<td>1列</td>
<td><input type="checkbox" id="checkbox1" value="是" /></td>
<td>3列</td>
<td>是</td>
</tr>
<tr>
<td>1列</td>
<td><input type="checkbox" id="checkbox2" value="否" /></td>
<td>3列</td>
<td>否</td>
</tr>
<tr>
<td>1列</td>
<td><input type="checkbox" id="checkbox3" value="否" /></td>
<td>3列</td>
<td>否</td>
</tr>
<tr>
<td>1列</td>
<td><input type="checkbox" id="checkbox4" value="是" /></td>
<td>3列</td>
<td>是</td>
</tr>
<tr>
<td>1列</td>
<td><input type="checkbox" id="checkbox5" value="是" /></td>
<td>3列</td>
<td>是</td>
</tr>
</table>
<table border="1" cellspacing="0" cellpadding="0" width="600" id="table">
<tr>
<td>1列</td>
<td><input type="checkbox" id="checkbox1" value="是" /></td>
<td>3列</td>
<td>是/否</td>
</tr>
</table>
$(function(){
$(':checkbox' , $('#table')).click(function(){
//方法一
console.log($(this).parent().next().next().text());
//方法二
console.log($(this).parents('tr').children().eq(3).text());
});
});