Thursday, May 12, 2005

IE can't set innerHTML for TBODY

In the following HTML, IE gives me "Unknown runtime error" at node.inner=fooBody.



<TABLE border="1">
<THEAD>
<TR><TH>Col 1</TH><TH>Col 2</TH><TR>
</THEAD>
<TBODY id="fooTbody">
</TBODY>
</TABLE>

<SCRIPT language="JavaScript">
var fooBody = "<TR><TD>Cell 1</TD><TD>Cell 2</TD></TR>";
var node = document.getElementById("fooTbody");
node.innerHTML = fooBody;
</SCRIPT>

3 comments:

Anonymous said...

hai,

i too have a sane issue here.can u pls help me

--- raja

Alex said...

My solution is use DIV tag as container, then I set the whole table fragment into this DIV instead of TBODY.

Anonymous said...

hei,
Thanx.i too found tht.But i can't able to get the stylehseet now.keep trying

-- raja