How to dynamically change content of a div using JavaScript?
This should do it:
<div id="foo">Div you want to change</div>
And in JavaScript:
document.getElementById('foo').innerHTML = 'Your content';
2.1m questions
2.1m answers
60 comments
57.0k users