直接cloneNode就可以了<script>
function addRow(){
var tab1=document.getElementById("table1");
var tab2=document.getElementById("table2");
newtr = tab2.getElementsByTagName("tr")[0].cloneNode(true);
tab1.childNodes[0].appendChild(newtr);
}
</script>
<table id=table1 bgcolor="red">
</table>
<table id=table2>
<tr width=90 onClick='javascript:alert(this.innerHTML);'>
<td>1</td>
<td>2</td>
</tr>
</table>
<input type="button" onclick="addRow()"/>
function addRow(){
var tab1=document.getElementById("table1");
var tab2=document.getElementById("table2");
newtr = tab2.getElementsByTagName("tr")[0].cloneNode(true);
tab1.childNodes[0].appendChild(newtr);
}
</script>
<table id=table1 bgcolor="red">
</table>
<table id=table2>
<tr width=90 onClick='javascript:alert(this.innerHTML);'>
<td>1</td>
<td>2</td>
</tr>
</table>
<input type="button" onclick="addRow()"/>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货