...

View Full Version : Remove Span Element



tuxcoder
02-02-2007, 09:43 AM
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??

Bill Posters
02-02-2007, 09:47 AM
The removeChild method needs to be used on the k span's parent element.

e.g.

k.parentNode.removeChild(k);

tuxcoder
02-02-2007, 10:00 AM
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?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum