Skip to content

Remove all child elements of a DOM node in JavaScript

Learn how to remove all child elements of a HTML DOM node in JavaScript.

var list = document.getElementById("myList");
   while (list.hasChildNodes()) {
See also  Plus One Linked List - Leetcode Challenge - Python Solution

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.