// Create a <li> node
var newElem = document.createElement("LI");
// Create a text node
var textnode = document.createTextNode("Water");
// Append the text to <li>
newElem.appendChild(textnode);
// Get the <ul> element to insert a new node
var list = document.getElementById("myList");
// Insert <li> before the first child of <ul>
list.insertBefore(newElem, list.childNodes[0]);