View Full Version : appendChild under IE

03-29-2004, 03:53 PM
Following code works fine under Mozilla 1.6 but not under IE6; it doesn't produce errors, but the appendChild method seems to be completely ignored.
Can someone explain me the reason/solution? Thanks



function test()
var tbl = document.getElementById("testTable");
var trElm = document.getElementById("testTr");
var newTr = trElm.cloneNode(true);



<table border="1" id="testTable" name="testTable">

<tr id="testTr" name="testTr">


<input type="button" onclick="javascript:test()" value="Test">


03-29-2004, 04:13 PM
You need to append the trs to the tbody, instead of directly under the table.

03-29-2004, 07:11 PM
This is a very common problem. I think we should put it as a sticky or an FAQ or something, but also it should be more explicit in tutorials, etc..


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum