<html>
<body>
<ul><li>Coffee</li><li id="myLI">Tea</li><li>Milk</li></ul>
<p>Click the button to remove the li element with id="myLI" from the list.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
var item = document.getElementById("myLI");
item.parentNode.removeChild(item);
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_node_removechild3 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:02:20 GMT -->
</html>