...

View Full Version : remove child by ID



Jerome
07-08-2003, 05:39 PM
Hi,

Already read the thread from Graeme, but still doen't understand it completely.

How can I remove a div with an id, without saying it's child-number x from the body or else.

Basicly I want:

remove: document.getElementById('divx') ;

Thanks for Your time,
Jerome

mordred
07-08-2003, 06:59 PM
You're almost there...



var elm = document.getElementById('divx');
elm.parentNode.removeChild(elm);

Jerome
07-08-2003, 08:08 PM
Herzlichen Dank...

Jerome



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum