<table id="myTable">
<tr>
<td>row0 cell0</td>
<td>row0 cell1</td>
<td>row0 cell2</td>
</tr>
<tr>
<td>row1 cell0</td>
<td>row1 cell1</td>
<td>row1 cell2
<input type="text" name="txt1″ id="txt1″ value="xxx">
<input type="text" name="txt2″ id="txt2″ value="yyy">
</td>
</tr>
</table>
付與表格欄位值:
document.getElementById("myTable").rows[0].cells[2]. innerHTML = "123″;
取得表格欄位中表單元素裡的值:
document.getElementById("myTable").rows[1].cells[2].firstChild.value;
document.getElementById("myTable").rows[1].cells[2].children[0].value;