Removes a DOM element.
- Source:
Methods
(static) removeElement(element) → {HTMLElement}
- Source:
Example
import { removeElement } from '@untemps/utils/dom/removeElement'
const element = document.createElement('div')
element.className = 'foo'
document.body.appendChild(element)
removeElement(element) // <div class="foo"></div>
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement | string | The DOM element or the selector of the DOM element to remove. |
Returns:
The removed DOM element.
- Type
- HTMLElement