I have many in my html and want to add more through javascript. However, using innerHTML is just replacin
In most browsers, you can use a javascript variable instead of using document.getElementById. Say your html body content is like this:
Hello
Then you can just refer to mySection as a variable in javascript:
mySection.innerText += ', world'
// same as: document.getElementById('mySection').innerText += ', world'
See this snippet:
mySection.innerText += ', world!'
Hello