您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

分享一个jQuery获取表格总行数的实例代码

2024/3/15 18:02:08发布24次查看
例子,jquery获取表格总行数:
var row count = $('#mytable tr').length; var rowcount = $('#mytable >tbody >tr').length; $("#mytable").attr('rows').length; var rowcount = $('table#mytable:last').index() + 1; //helper function that gets a count of all the rows <tr> in a table body <tbody> $.fn.rowcount = function() { return $('tr', $(this).find('tbody')).length; }; // usage: var rowcount = $('#producttypestable').rowcount(); alert(jquery("#jtklist").find("table").eq(0).find("tr").length);
以上就是分享一个jquery获取表格总行数的实例代码的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product