<script language="javascript">
function addRow()
{
var root = document.getElementById("tbody")
var allRows = root.getElementsByTagName('tr');
var allCells = allRows[0].getElementsByTagName('td');
var newRow = root.insertRow();
var newCell0 = newRow.insertCell();
var newCell1 = newRow.insertCell();
newCell0.innerHTML = allCells[0].innerHTML;
newCell1.innerHTML = allCells[1].innerHTML;
}
function removeRow(r)
{
var root = r.parentNode;
root.deleteRow(r);
}
</script>
<html>
<body>
<table>
<tr>
<td>
<input type="button" οnclick="addRow()" name="Submit" value="添加">
</td>
</tr>
<tbody id="tbody">
<tr>
<td><input name="jcsj" type="text"/></td>
<td><input type="button" value="删除" οnclick="removeRow(this.parentNode.parentNode)"/></td>
</tr>
</tbody>
</table>
</body>
</html>
function addRow()
{
var root = document.getElementById("tbody")
var allRows = root.getElementsByTagName('tr');
var allCells = allRows[0].getElementsByTagName('td');
var newRow = root.insertRow();
var newCell0 = newRow.insertCell();
var newCell1 = newRow.insertCell();
newCell0.innerHTML = allCells[0].innerHTML;
newCell1.innerHTML = allCells[1].innerHTML;
}
function removeRow(r)
{
var root = r.parentNode;
root.deleteRow(r);
}
</script>
<html>
<body>
<table>
<tr>
<td>
<input type="button" οnclick="addRow()" name="Submit" value="添加">
</td>
</tr>
<tbody id="tbody">
<tr>
<td><input name="jcsj" type="text"/></td>
<td><input type="button" value="删除" οnclick="removeRow(this.parentNode.parentNode)"/></td>
</tr>
</tbody>
</table>
</body>
</html>