The in-built functions used are listed below.
- Create new elements: We can create new elements using the document.createElement() function. It will create elements dynamically.
- Append element: We can append elements using the function appendchild().
- Create text node: We can create a text node using the document.createTextNode() element. HTML consists of both an element node and a text node. So createTextNode() method creates a text node with the specified text.
- Remove existing element: We can remove a child from the created list by using removechild() function.
Output: Now, click on add item to add any item to the list. Click on remove item to delete any item from the list.