HTML DOM removeChild() Method

The removeChild() method is used to removes a specified child of the specified element. The syntax of removeChild() method is as follows :
where the node represent the object you want to remove.
  <ul id="list">
    <li>First List</a></li>
    <li>Second List</a></li>
    <li>Third List</li>
    <li>Fourth List</li>
  <button onclick="myfunc()">Click Here</button>
    function myfunc() {
      var elem = document.getElementById('list');
Output :

  • First List
  • Second List
  • Third List
  • Fourth List

Next Topic :