js获取当前table的选择行数 js怎么获取当前table的选中行数???是选中行数 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 怎么算选中? checkbox 还是点击一行就算选中? 点击一行算选中啊,没有checkbox 那就是取当前Table点击的行数... 你給动态生成table的时候的每一个tr设置一个id(eg: 1,2,3,4....)然后用jquery来取onclick时候的tr对应id值 <tr onclick="alert(this.rowIndex)" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head> <title>Untitled Page</title> <script type="text/javascript" src="jquery-1.4.4.js"></script> <script type="text/javascript"> $(function(){ $("#table1 tr").each(function(i){ $(this).click(function(){ alert("你点击的是第"+(i+1)+"行"); }); }); }); </script></head><body><table id="table1" border="1" cellpadding="1" cellspacing="1"><tr><td>1</td></tr><tr><td>2</td></tr><tr><td>3</td></tr><tr><td>4</td></tr></table></body></html> object 是什么类型的对象啊? 各位前辈,小弟先谢过了!!关于AspxGrid 请问一下Assembly是哈东东? asp与asp.net有什么区别 天津公司招asp.net程序员 DataGrid 绑定事件 ItemDataBound 中可以编辑自己添加到网格中控件吗??? ASP.NET页面事件:顺序与回传详解 datagrid边框不显示如何搞?如原来是日字状的DATAGRID.要求显示中间"一"字!谢谢 我有asp的基础了,要学好.net要多久时间呢 C# .NET 模拟登录带有验证码的网站,并自动提交表单数据! 问一个弹出页面的问题、 js 的返回值
然后用jquery来取onclick时候的tr对应id值
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script type="text/javascript" src="jquery-1.4.4.js"></script>
<script type="text/javascript">
$(function(){
$("#table1 tr").each(function(i){
$(this).click(function(){
alert("你点击的是第"+(i+1)+"行");
});
});
});
</script>
</head>
<body>
<table id="table1" border="1" cellpadding="1" cellspacing="1">
<tr><td>1</td></tr>
<tr><td>2</td></tr>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
</table>
</body>
</html>