Set new element's content to the value of the text property of the object code example
Example 1: .innerhtml
// .innerHTML method is used to change the html contents of a DOM object
document.getElementById("demo").innerHTML = "Paragraph changed!";
Example 2: set text of dom element
document.getElementById("myBtn").textContent = 'Hello World';