1: 遍历并输出Table中值
function f()
{
var t=document.getElementById("tb").childNodes.item(0);
for(var i=0;i< t.childNodes.length;i++)
{
for(var j=0;j
{
alert(t.childNodes(i).childNodes(j).innerText);
}
}
}
2: 遍历Table,读取CheckBox状态和其他Column值
Untitled Pagefunction f()
{
var t=document.getElementById("tb").childNodes.item(0);
for(var i=0;i< t.childNodes.length;i++)
{
alert(t.childNodes(i).firstChild.firstChild.nodeValue);
alert(t.childNodes(i).childNodes[1].firstChild.checked);
}
}
1234 | ||
2234 | ||
3234 |