關於firefox,ie firstChild.cloneNode(true)奇怪問題

關於firefox,ie  firstChild.cloneNode(true)奇怪問題

<html>
<head><title></title></head>
<script language="">
function B()
{
   newnode=document.getElementById("aa").firstChild.cloneNode(true);
   document.getElementById("bb").appendChild(newnode);
}
</script>
<body>

<table>
<tbody id="aa"><tr>
    <td>dfdddddddd</td>
</tr>
</tbody>
<tbody id="bb"></tbody>
</table>
<input type="button" onclick="B();" value="Test" />


</body>
</html>

這樣寫則都正常

如果把<tbody id="aa"><tr>  寫在不同行
<tbody id="aa">
<tr>

則IE下正常,FireFox下就不正常
原文地址:https://www.cnblogs.com/wang123/p/1076089.html