[Javascript] removeChild() ???

Peter-Paul Koch gassinaumasis at hotmail.com
Thu Jan 31 04:46:26 CST 2002



>I have the following code:
>   var oTD = document.all.tags("TD");  //Every TD contains one or more DIVS
>(only)
>
>   alert('#childs before delete: ' +oTD[0].children.length);
>
>   oTD[iCnt].removeChild(oTD[iCnt].children(iTmp_01));
>
>   alert('#childs after delete: ' +oTD[iCnt].children.length);
>
>My problem is that I dont understand why, help me god,
>oTD[iCnt].children.length most of the times return same number before as
>after, meaning ... I cannot remove elements as I want to.
>
>Help me please ...

What do you want to remove? The children of the TD's or the TD's themselves? 
Does the script have to remain IE-only?

See http://www.xs4all.nl/~ppk/js/index.html?version5.html for more 
information about removeChild/removeNode and children/childNodes.

ppk

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




More information about the Javascript mailing list