[Javascript] removeChild() ???

Mikael Lindström mikael.lindstrom at nipsoft.se
Thu Jan 31 03:03:43 CST 2002


Sorry, but some corrections

this is the code:


  var oTD = document.all.tags("TD");
  //Every TD contains one or more DIVS (only)
  iCnt = 0;
  iTmp_01 = 0;

  alert('#childs before delete: ' +oTD[iCnt].children.length);

  oTD[iCnt].removeChild(oTD[iCnt].children(iTmp_01));

  alert('#childs after delete: ' +oTD[iCnt].children.length);



Michael





> -----Original Message-----
> From: javascript-admin at LaTech.edu
> [mailto:javascript-admin at LaTech.edu]On
> Behalf Of Mikael Lindström
> Sent: Thursday, January 31, 2002 9:51 AM
> To: javascript at LaTech.edu
> Subject: [Javascript] removeChild() ???
>
>
> 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
> >
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>





More information about the Javascript mailing list