Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
-1
rated 0 times [  6] [ 7]  / answers: 1 / hits: 120191  / 13 Years ago, wed, august 24, 2011, 12:00:00

I'm trying to do this with pure javascript, not with jquery. I have a div that has an id test and contains other divs inside it. How do I empty the content of this div and replace it with other html?



<div id=test>
<div>...</div>
<div>...</div>
<div>...</div>
</div>

More From » javascript

 Answers
17
document.getElementById(test).innerHTML = new content

[#90442] Tuesday, August 23, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
larrycodys

Total Points: 394
Total Questions: 93
Total Answers: 78

Location: Romania
Member since Mon, Jun 6, 2022
2 Years ago
;