jQuery获取table当前所在行

$("div tbody tr").click(function() {      
   var rows = $(this).prevAll().length + 1;//行号
   alert(rows );
  });


//获取表的总行数 tr

$("#tableid").find("tr").length ;

//获取所在行的行号

$(this).parent().prevAll().length + 1;//行号

//获取所在列的列号

$(this).prevAll().length + 1;//列
---------------------
作者:xhx夏
来源:CSDN
原文:https://blog.csdn.net/u014328353/article/details/78241887?utm_source=copy
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自www.cnblogs.com/asdyzh/p/9774861.html