clearing out a

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I need to clear out the HTML contents of a <span> element and then
re-add that element as a blank span.

Here is the code...

var elem = document.getElementById(spanId);

var deletedElem = elem.parentNode.removeChild(elem);
deletedElem.innerHTML = '<span id="'+spanId+'"></span>';

This does not work. When I try to getElementById the second time the
function is called it does not find the span I added. Any suggestions?

Thanks in advance for any help.

Re: clearing out a

"" wrote in comp.infosystems.www.authoring.html:
>var elem = document.getElementById(spanId);

Javascript questions (if the above is Javascript) are better
directed to a Javascript group. This is


Stan Brown, Oak Road Systems, Tompkins County, New York, USA

Site Timeline