<html>
<head>
<title>rw1</title>
<script type="text/iavascript">
winfow.οnlοad=function(){
var mytable=document.getElementById("students");
var nodes=mytable.childNodes;
for(var i=0;i<nodes.length;i++){
if(nodes[i].nodeName.toUpperCase()=='TBODY'){
var trs=nodes[i].childNodes;
for(var j=0;j<trs.length;j++){
if(trs[j].nodeName!='#text'){
var tds=trs[j].childNodes;
for(var k=0;k<tds.length;k++){
if(tds[k].nodeName!='#text'){
alert(tds[k].innerHTML);
}
}
}
}
}
}
}
</script>
</head>
<body>
<table id="students" width="200" border="1">
<thead>
<tr> <td>学号</td> <td>姓名</td> <td>年龄</td></tr>
</thead>
<tbody>
<tr><td>1001</td> <td>张三<td> <td>15</td></tr>
<tr><td>1002</td><td>李宁</td><td>14</td></tr>
<tr><td>1003</td><td>李四</td><td>18</td></tr>
</tbody>
</table>
</body>
</html>