[thelist] appendchild problem

Peter-Paul Koch gassinaumasis at hotmail.com
Tue Nov 6 02:44:34 CST 2001


>hi! I'm working with IE 5.5 and wanted to do this
>
>div1.appendChild div2.removeNode(true)

In any case it should be

div1.appendChild(div2.removeNode(true))

However:

1) removeNode is MS proprietary, instead you should do

div2.parentNode.removeChild(div2)

2) it isn't necessary to remove a node before appending it. If you do

div1.appendChild(div2)

it works fine: the node is removed from its erstwhile position and appended 
to the new position.
For more info on all these methods and properties, see the W3C DOM 
Compatibility Table: http://www.xs4all.nl/~ppk/js/index.html?version5.html

ppk

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





More information about the thelist mailing list