用js遍历table的脚本_javascript技巧
时间:2021-07-01 10:21:17
帮助过:45人阅读
var tableObj = document.getElementById("tableName");
var str = "";
for(var i=0;i
{
for(varj=0;j {
//str += tableObj.rows[i].cells[j].innerHTML+" ";
for(var z=0;z {
var text = tableObj.rows[i].cells[j].children[z];//取得text object
str += text.value;
}
}
str+="\n";
}
alert(str);
用js遍历 table