removing a child node

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • omerbutt
    Contributor
    • Nov 2006
    • 638

    #16
    Originally posted by gits
    so the alerts you did are what you expected? ... then please post what the following alert says when you want to remove a node:

    [CODE=javascript]function removediv(){
    var divno = document.getEle mentById('count ').value;
    var d = document.getEle mentById('txtHi nt'+0);

    alert(d.innerHT ML);

    var divname ='txtHint'+divn o;
    var olddiv =document.getEl ementById(divna me);
    d.removeChild(o lddiv);
    }[/CODE]
    hey gits just when i posted the last reply i saw the main error which is in the very first line see the id of the div :D it is "txthint1 not txtHint1 :D man that was very common but irritating mistake and was occurin in the mozilla because mozilla is case sensitive and explorer is not thats why it was deleting in the IE but not mozilla thanks to you gits you made a goooood ALERT() cheers many thanks
    regards,
    omer

    Comment

    • omerbutt
      Contributor
      • Nov 2006
      • 638

      #17
      Originally posted by gits
      so now ... have a look at the first line there:

      [HTML]<div id="txthint1">< td class="tdTitle" align="left" width="600">
      [/HTML]
      so i assume now you want to remove that div? but as we see the id="txthint1' and not txtHint1 as you try to refer in your remove function?

      kind regards
      :D yeah i just got late poting the reply but i also saw the error and mentioned in my post any ways thanks aloots Gits
      You are the MAN ;)
      regards,
      omer

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #18
        no problem ... the alert just showed you what i was trying to explain before :) ... glad to hear you got it working now :)

        kind regards

        Comment

        • omerbutt
          Contributor
          • Nov 2006
          • 638

          #19
          Originally posted by gits
          no problem ... the alert just showed you what i was trying to explain before :) ... glad to hear you got it working now :)

          kind regards
          :) thanks a bundle :)
          regards,
          omer

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #20
            Good spot, gits.
            Originally posted by omerbutt
            that was very common but irritating mistake and was occurin in the mozilla because mozilla is case sensitive and explorer is not thats why it was deleting in the IE but not mozilla
            That's shoddy by IE. JavaScript is case-sensitive, not case-insensitive like VB.

            Comment

            • omerbutt
              Contributor
              • Nov 2006
              • 638

              #21
              Originally posted by acoder
              Good spot, gits.
              That's shoddy by IE. JavaScript is case-sensitive, not case-insensitive like VB.
              :) what to say ?...... any ways thanks alot guys ,
              regards,
              omer

              Comment

              Working...