js element add text 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
var paragraph = document.getElementById("p");
var text = document.createTextNode("This just got added");
paragraph.appendChild(text);