Node.appendChild
returns the child that was appended to the node.
So after you append the text node to the li
you append it to the ul
(removing it from the li
)
ipDOM=document.getElementById("ulref");
x = document.createElement('LI');
y = document.createTextNode("hello");
x.appendChild(y); // append the text node to the li
ipDOM.appendChild(x); //append the li to the ul