.is(selector)
Available on: InDom

Checks if the underlying element matches a CSS selector

Parameters:
selector {string} - CSS selector to match against.

Returns: {boolean} - True if matches , false if doesn't

Throws:
Error - If the underlying element has been removed

Examples:
const example = $1('.example>div');
console.log(example.is('div'));
//true 
console.log(example.is('.test'));
//false
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.