InDom.get(selector, container?)
Shortcut: $a

Queries the DOM using the CSS selector and returns an InDomArray of InDom objects for each matching DOM element.
Returns an empty InDomArray if no matching elements are found.

Parameters:
selector {string} - CSS selector string
container {ParentNode | InDom} (optional) - The container element or InDom object to search within. Defaults to document.

Returns: {InDomArray} - InDomArray object, empty when none found

Examples:
// Set style on every '.example'
$a('.example').setStyle('color', 'blue');

// Set click event on every '.example>span'
$a('.example>span').onClick(n => {
	n.setStyle('color','green');
});

// The same, written as a single-line arrow function: 
$a('.example>span').onClick(n => n.setStyle('color', 'green'));

const example1 = $1('.example');
//Set data 'init': 1 on direct children 'div' of the first '.example'
$a('>div', example1).setData('init', 1);

//InDomArray objects themselves don't have get* methods
//Get the left and top of each '.example>div' relative to viewport
$a('.example>div').each(n => {
	// .getBox() returns the bounding box
	const box = n.getBox();
	console.log(`left:${box.left} top:${box.top}`);
});
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.