Click here to get back home

clearing out a

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
clearing out a JehanNYNJ 05-03-2005
Posted by JehanNYNJ on May 3, 2005, 1:06 pm
Please log in for more thread options


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>';
deletedElem.parentNode.appendChild(deletedElem);

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.


Posted by Stan Brown on May 3, 2005, 5:15 pm
Please log in for more thread options


"" 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
comp.infosystems.www.authoring.HTML.

--

Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/


Similar ThreadsPosted
selected clearing January 24, 2008, 11:36 am
Memory clearing and reload. January 23, 2005, 3:00 pm
Clearing floaters in Mozilla August 19, 2005, 6:03 pm
clearing only local floats November 11, 2006, 11:22 am
Clearing floats without introducing a new line. How? August 18, 2005, 2:47 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap