动态创建 table row cell ( insertRow ,insertCell )
1function add(){ var obj = document.getElementById("tbl"); var newRow = obj.insertRow(0); var newCell = newRow.insertCell(0); var clonetd = obj.rows.cells.cloneNode(true); newCell.innerHTML = clonetd.innerHTML; //obj.deleteRow(1);}
2
<table id="tbl"><tr> <td>钓鱼岛是中国的!<input type="text" value="" /></td> </tr></table><a >add</a>
3
页:
[1]