PDA

View Full Version : Vraagh. What's the IE-equivalent of .removeChild()?


AaronW
06-21-2005, 02:39 AM
Seems I can call obj.removeChild(child) without error, but only sometimes. I'm not sure what's going on, but I can't find .removeChild () in any msdn documentation relating to the DOM.

So what's the IE-way of going about removing an element from the document?

Thanks :)

enumerator
06-21-2005, 03:12 AM
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/removechild.asp

AaronW
06-21-2005, 04:02 AM
I wrapped it in the ol' try {} catch (e) {} and it worked. Then I ditched the whole "create and remove" idea and just toggled the display property while switching .innerHTML.

Kor
06-21-2005, 10:24 AM
I have never had problems with removeChild() methods on IE (IE6 on XP, IE6 on Win2000). What IE have you? If IE5 for Mac, it has a lot of bugs (even Bill Gates knows that), this is the reason for Safari has no real challanger till now.