1: 遍历并输出 Tabla 中值
<table id = "tb"> <tr> <td> </td> </tr> <tr> <tr> <td> </td> </tr> </table> function f () {var t = document.getElementById ("tb"). ChildNodes.item (0); for (var i = 0; i <t.childNodes.length; i ++) j = 0; j <t.childnodes (i) .childnodes.length; j ++) {alert (t.childnodes (i) .childnodes (j) .inntext);}}2: 遍历 Tabla 读取 读取 Casabía de verificación 状态和其他 Columna 值
< xmlns = "http://www.w3.org/1999/xhtml"> <Head> <title> Página sin título </title> </head> <body body onload = "f ()"> <script type = "text/javaScript"> function f () {var t = document.getElementByid ("TB"). i = 0; i <t.childnodes.length; i ++) {alert (t.childnodes (i) .firstchild.firstchild.nodevalue); alert (t.childnodes (i) .childnodes [1] .firstchild.checked); }}</script><table id="tb"><tr><td>1234</td><td><input type="checkbox" /></td><td></td></tr><tr><td>2234</td><td><input type="checkbox" checked="CHECKED" /> </td> <td> </td> </tr> <tr> <td> 3234 </td> <td> <input type = "checkbox"/> </td> <td> </td> </tr> </table> </body> </html>