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
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Remove Span Element

    Hello

    I have a function whit i get the ID for the element Span.

    Now i want remove this element.

    But it dosnt work.

    My code:

    var k = document.getElementById(nr);

    k.removeChild(k.childNodes(0));

    Can somebody help me??

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    The removeChild method needs to be used on the k span's parent element.

    e.g.
    Code:
    k.parentNode.removeChild(k);
    Last edited by Bill Posters; 02-02-2007 at 09:53 AM.

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks very much. It works perfect :-)

    Now i want to create an array like this:

    Array (
    [1] => Array ( [d] => 3 [ti] => 6 [time] => 7 )
    [2] => Array ( [d] => 3 [ti] => 6 [time] => 7 )
    )

    My values are:

    var valued = day.options[d.selectedIndex].value;
    var valueb = begin.options[b.selectedIndex].value;
    var valuee = ende.options[e.selectedIndex].value;

    How can i do it?
    Last edited by tuxcoder; 02-02-2007 at 10:04 AM.


  •  

    Posting Permissions

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