やってみた:</p>
<table id ="table1">
<tr id ="aa"><td>aa</td></tr>
<tr id ="bb"><td>bb</td></tr>
</table>
<input type="button" onclick = "test()" value = "button">
そしてJavaScript:</p>
function test(){
var parent=document.getElementById("table1");
var child=document.getElementById("aa");
parent.removeChild(child); //this isn't work
//child.parentNode.removeChild(child); this is ok!
}
エラー:
Uncaught NotFoundError: ノードが存在しないコンテキストでノードを参照しようとしました
したがって、テーブルはtrの親ではありませんか?