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