Answers for "clear element children js"

0

clear element children js

const myNode = document.getElementById("foo");
myNode.textContent = '';
Posted by: Guest on October-14-2021
-1

javascript clear child elements

parent.querySelectorAll("*").forEach(child -> child.remove());

//Change the value of * if there is a specific class you want to remove 
//otherwise leave the * for removing all child elements.
Posted by: Guest on June-19-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language