append element to html javascript code example
Example 1: jquery append
$("p").append(" <b>Appended text</b>.");
Example 2: create and append element in javascript
//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);