js add text to div code example
Example 1: how add text to element in javascript
var paragraph = document.getElementById("p");
paragraph.textContent += "This just got added";
Example 2: JavaScript append text to div
var div = document.getElementById('myElementID');
div.innerHTML += "Here is some more data appended";
Example 3: how add text to element in javascript
var p = document.getElementById("p")
p.innerText = p.innerText+" And this is addon."