Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-02-2007, 09:43 AM   PM User | #1
tuxcoder
New to the CF scene

 
Join Date: Feb 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
tuxcoder is an unknown quantity at this point
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??
tuxcoder is offline   Reply With Quote
Old 02-02-2007, 09:47 AM   PM User | #2
Bill Posters
Senior Coder

 
Join Date: Feb 2003
Posts: 1,665
Thanks: 0
Thanked 27 Times in 25 Posts
Bill Posters will become famous soon enough
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..
Bill Posters is offline   Reply With Quote
Old 02-02-2007, 10:00 AM   PM User | #3
tuxcoder
New to the CF scene

 
Join Date: Feb 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
tuxcoder is an unknown quantity at this point
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..
tuxcoder is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:27 AM.


Advertisement
Log in to turn off these ads.