diff --git a/contents/remove-all-children-of-a-node.mdx b/contents/remove-all-children-of-a-node.mdx index 8dc3485..130e5a8 100644 --- a/contents/remove-all-children-of-a-node.mdx +++ b/contents/remove-all-children-of-a-node.mdx @@ -23,6 +23,14 @@ while (node.firstChild) { } ``` +## 3. Replace the child nodes + +Replace its child nodes with... nothing: + +```js +node.replaceChildren(); +``` + ## See also - [Remove an element](https://phuoc.ng/collection/html-dom/remove-an-element/)