IE insertBefore method acting funny

lozina

Lifer
Sep 10, 2001
11,711
8
81
I am trying to dynamically insert a row into a table using insertBefore. Its not working in ie.

Following code has two example, the one on top with a table does not work, the one on bottom with a list works. why? they are pretty much doing exactly the same thing ....

you can test this by just copy and pasting this into a new notepad file, then save it as something like test.htm, and double click to open in browser.

Any workarounds?
 

lozina

Lifer
Sep 10, 2001
11,711
8
81
Well, found a workaround on a website that seems to do the trick. Added a <tbody> tag inside that table and gave it the id of "thetarget" instead of the <table> tag.

ah well.