当前位置:Gxlcms > html代码 > [转]jquery遍历table的tr获取td的值_html/css_WEB-ITnose

[转]jquery遍历table的tr获取td的值_html/css_WEB-ITnose

时间:2021-07-01 10:21:17 帮助过:36人阅读

html代码:

 1  2  3  4  5  6 删除 7  8  9 10 11 12 删除13 14 15 16 17 18 删除19 20 21   

 

方法一:

var trList = $("#history_income_list").children("tr") for (var i=0;i

方法二:

$("#history_income_list").find("tr").each(function(){ var tdArr = $(this).children(); var history_income_type = tdArr.eq(0).find("input").val();//收入类别 var history_income_money = tdArr.eq(1).find("input").val();//收入金额 var history_income_remark = tdArr.eq(2).find("input").val();// 备注 alert(history_income_type); alert(history_income_money); alert(history_income_remark); });

人气教程排行