Snippets Collections
// Select the parent element
const parent = document.getElementById('parentElementId');

// While the parent has child nodes, remove the first one
while (parent.firstChild) {
    parent.removeChild(parent.firstChild);
}
star

Mon Jul 29 2024 08:32:29 GMT+0000 (Coordinated Universal Time)

#firstchild #remove

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension