[thelist] cross-browser way to remove/replace node? (DOM)

Tom Dell'Aringa pixelmech at yahoo.com
Mon Nov 17 15:34:37 CST 2003

I'm working on a little application where some text (names) is added
to a hidden div, then the div is shown.

I started using innerHTML then switched to the DOM because I had some
problems which I won't go into. In short, this is what I am doing:

for(var x=0; x<workerArray.length; x++)
   newP = document.createElement("P");
   newText = document.createTextNode(workerArray[x]);

workerArray is a list of names. workerList is the DIV. So when you
click a link, you get a little window that shows you what workers are
in that time section.

Problem is that this page does not get reloaded, so the content I
added persists. According to PPK [1] removeNode() does not work in
Mozzilla 1.4 and other browsers, since it is a MS extension. Does it
work in NS6+?

Is my only option here innerHTML?


[1] http://www.quirksmode.org/

http://www.pixelmech.com/ :: Web Development Services
http://www.DMXzone.com/ :: JavaScript Author / Every Friday!
http://www.thywordistruth.net/ :: Eternal Life

"I'll ho ho and ha ha you!" (Daffy Duck)

More information about the thelist mailing list