add text to element code example
Example 1: how add text to element in javascript
var paragraph = document.getElementById("p");
var text = document.createTextNode("This just got added");
paragraph.appendChild(text);
Example 2: how add text to element in javascript
document.getElementById("p").textContent += " this has just been added";