Opally
08-31-2007, 10:59 PM
Hi!
I'd like to execute this only once, and can't figure out the correct while syntax.
this while doesn't work, but the span removal does.
var statelabel = document.getElementById('statelabel');
var span = statelabel.getElementsByTagName('span');
while (statelabel.childNode(span[0])) {
statelabel.removeChild(span[0]);
}
I'm removing a <span></span> tag from inside a label element.
thanks!
---opally
I'd like to execute this only once, and can't figure out the correct while syntax.
this while doesn't work, but the span removal does.
var statelabel = document.getElementById('statelabel');
var span = statelabel.getElementsByTagName('span');
while (statelabel.childNode(span[0])) {
statelabel.removeChild(span[0]);
}
I'm removing a <span></span> tag from inside a label element.
thanks!
---opally