11智能在线
新记
jquery问题:获取table里第5个td的text()
有4个table,循环出来的,class一样,现在想获取table里第5行tr里td的内容,如果为空,则删除当行tr。
举报该文章
其他看法
第1个回答 推荐于2016-04-24
$("table").find("tr:eq(4)").each(function () {
if($.trim($(this).text())==""){
$(this).remove();
}
});本回答被提问者采纳
第2个回答 2015-04-28
$(".classname").find("tr:eq(4)").each(function (i){
var text = $(this).find("td").html();
if($.trim(text)==""){
$(this).remove();
}
});
追问
谢谢!
相似回答
大家正在搜
相关问题
JQuery 根据TableID获取Table下面Tbody...
jquery怎么获取table中的某个td的值
jQuery怎么获取某表格中的一列td的值
Jquery如何获取<td></td>中的文字?
jQuery怎么获取某表格中的一列td的值?
jquery怎么获取table里的td都有font,怎么获取...
如何用jquery获得td里边的内容
jquery 取第一个TR所有TD的数据的方法