append element javascript

JavaScript
 var node = document.createElement("LI");                 // Create a <li> node

 var textnode = document.createTextNode("Water");         // Create a text node

 node.appendChild(textnode);                              // Append the text to <li>

 document.getElementById("myList").appendChild(node);     // Append <li> to <ul> with id="myList" //create and append element
 var node = document.createElement("LI");                 // Create a <li> node

 var textnode = document.createTextNode("Water");         // Create a text node

 node.appendChild(textnode);                              // Append the text to <li>

 document.getElementById("myList").appendChild(node);     // Append <li> to <ul> with id="myList" let parent = document.createElement("div")
parent.append("Some text")

console.log(parent.textContent) // "Some text"var list=[1, 2, 3, 4, 5];
list.push(6);
// .push allows you to add a value to the end of a list var div = document.getElementById('myElementID');
div.innerHTML += "Here is some more data appended";convert string to byte
Source

Also in JavaScript: