.getOffsetBox()
Available on: InDom

Returns a DOMRect with document / page-relative coordinates: left and top are measured from the top-left corner of the document.

Returns: {DOMRect} - Native object with left / x, top / y, width, height, right, bottom.

Throws:
Error - If the underlying element has been removed
Error - If the underlying element is not connected to the document

Examples:
const div = $n('<div></div>');
div.setStyle({
	position: 'absolute',
	top: '100px',
	left: '120px',
	width: '80px',
	height: '60px'
});
$1('body').append(div);

console.log(JSON.stringify(div.getOffsetBox()));
//DOMRect {"x":120,"y":100,"width":80,"height":60,"top":100,"right":200,"bottom":160,"left":120}
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.