Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    remove child by ID

    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

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You're almost there...

    Code:
    var elm = document.getElementById('divx');
    elm.parentNode.removeChild(elm);
    De gustibus non est disputandum.

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Herzlichen Dank...

    Jerome


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •