Answers for "how to append text using js"

8

JavaScript append text to div

var div = document.getElementById('myElementID');
div.innerHTML += "Here is some more data appended";
Posted by: Guest on August-05-2019
0

how add text to element in javascript

var h = document.createElement("H1")                // Create a <h1> element

 var t = document.createTextNode("Hello World");     // Create a text node

 h.appendChild(t);                                   // Append the text to <h1>
Posted by: Guest on May-19-2021

Code answers related to "how to append text using js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language