.remove()
Available on: InDom, InDomArray

Cleans the internal state of the InDom object(s) and removes the underlying DOM element(s) from the document.
This method is also triggered automatically, when the element is removed from the DOM by any other means.

Throws:
Error - If the underlying element (or an element in case of InDomArray) has already been removed

Examples:
// remove the first .example>div
$1(".example>div").remove(); 

// remove all .example>div
$a(".example>div").remove();
Next: is »
Modern DOM Power
for TypeScript, ESM & Plain JS
3.8KB JavaScript library that simplifies DOM manipulation
with a clean, chainable API for events, data, inputs harvesting, and more.
Automatic Cleanup,
Leak-Proof by Design
Events and state are cleared when elements leave the DOM,
even if removal happens outside InDom.
Cleaner Code,
Better Ergonomics
Get the InDom object directly in callbacks.
One element, one instance.
Works With Your Existing Stack
Use InDom on its own or alongside any library or framework,
its architecture ensures a seamless integration.