Function: emptyDom()
ts
function emptyDom(el): void;Removes all child nodes from the specified DOM element.
Parameters
| Parameter | Type | Description |
|---|---|---|
el | HTMLElement | The DOM element to empty. |
Returns
void
Example
ts
const el = document.createElement('div')
el.textContent = 'hello'
emptyDom(el)
el.textContent // => ''Since
1.0.0