DOM innerHTML Duplicate Problem
- by Kubi
function SwapPlans(city, id) {
var tp = GetTravelPlanById(id);
var content = MakeHTMLAccordionMe(tp.items[0]);
document.getElementById(city).innerHTML = " ";
document.getElementById(city).innerHTML = content.innerHTML;
document.getElementById(city).outerHTML = " ";
document.getElementById(city).outerHTML = content.outerHTML;
}
Hi,
I have a problem with the snippet above. MakeAccordionME function returns the content that
I want to change by document.getElementById(city) = value; but It doesn't remove the first content of the first div.
Is there any content.clear method in DOM javascript ?
thx
p.s. the div that returns from document.getElementById(city) is a jquery accordion div.