UNPKG

@web3r/flowerkit

Version:

Tree-shakable JavaScript and TypeScript utility library for frontend/browser apps: DOM, events, arrays, objects, strings, date, JSON, and network helpers (ESM/CJS, SSR-friendly).

15 lines (14 loc) 609 B
export type TRemoveChildNodesArgs = Parameters<typeof removeChildNodes>; export type TRemoveChildNodesReturn = ReturnType<typeof removeChildNodes>; /** * Removes all child nodes of given node * @param el{Node} node * @throws {TypeError} removeChildNodes: el must be a Node * @example * // How to remove all child elements of a DOM node? * // <div id="myBlock"><div>Block with child nodes</div></div> * const myDiv = document.getElementById("myBlock"); * removeChildNodes(myDiv); * console.log(Array.from(myDiv.children).length); // => 0 */ export declare const removeChildNodes: (el: Node) => void;