<html>
<body>
<ul id="myList1"><li>Coffee</li><li>Tea</li></ul>
<ul id="myList2"><li>Water</li><li>Milk</li></ul>
<p>Click the button to move an item from one list to another.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
var node = document.getElementById("myList2").lastChild;
document.getElementById("myList1").appendChild(node);
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_node_appendchild2 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:03:46 GMT -->
</html>