html-dom
html-dom copied to clipboard
Use replaceChildren() to clear child nodes
The replaceChildren() node with no parameters can be used to quickly clear a node's children:
https://developer.mozilla.org/en-US/docs/Web/API/Element/replaceChildren#emptying_a_node