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