html DOM - insertBefore problem -
02-10-2006
, 11:33 AM
I am frustrated. It appears that one can not use insertBefore to insert
an A node before a DL node. Is that really true?
I *am* able to insert before a <p id="hh"> tag, but not before a <dl
id="hh"> tag.
i am also able to do a body.appendChild with no trouble.
Finally, winIE6 pops an error: 'Invalid argument' at the last snip line
below:
A snip from my code:
****
var newA = document.createElement("A");
var refObj=document.getElementById("hh");
//document.body.appendChild(newA); //works fine
document.body.insertBefore(newA,refObj);// winIE6 error: 'Invalid argument'
****
Any ideas why this is happening Is it me? or is there some rule I've
not been able to find?
Thanks for any help.
P.S. Same problem if I use "div1", a div wrapper around the dl node,
instead of body node.
emichael b. |