1、遍历tr中所有td中的内容
// 遍历 tr
$('#tab tr').each(function(i){
// 遍历 tr 的各个 td
$(this).children('td').each(function(j){
alert("第"+(i+1)+"行,第"+(j+1)+"个td的值:"+$(this).text());
});
});
2、获取父元素
$().parent()
1、遍历tr中所有td中的内容
// 遍历 tr
$('#tab tr').each(function(i){
// 遍历 tr 的各个 td
$(this).children('td').each(function(j){
alert("第"+(i+1)+"行,第"+(j+1)+"个td的值:"+$(this).text());
});
});
2、获取父元素
$().parent()