[Javascript] removeChild() ???

Mikael Lindström mikael.lindstrom at nipsoft.se
Thu Jan 31 02:51:29 CST 2002


Hi,

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 ...

Michael



> -----Original Message-----
> From: javascript-admin at LaTech.edu
> [mailto:javascript-admin at LaTech.edu]On
> Behalf Of Bill Marriott
> Sent: Thursday, October 11, 2001 11:11 PM
> To: javascript at LaTech.edu
> Subject: [Javascript] just Checking Checkboxes
>
>
> Hi Everyone,
>
> Today's problem for me is:
>
> How in Javascript can I 'Check' a checkbox box when I add it
> as an element
> in code?
> The code below will add it to the new row but I want to check
> it as well and
> if possible make it invisible
>
> Bill.
>
>
> var addObj = document.createElement("INPUT");  ////// a add check box
> addObj.type = "checkbox";
> addObj.name = "ADDLINK";
> addObj.id = "A1";
> var addObjParent = newRowObj.lastChild.previousSibling;
> addObjParent.appendChild(addObj);
>
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>





More information about the Javascript mailing list