const resizeObserver = new ResizeObserver((entries) => {
for (const entry of entries) {
const elemSize = entry.contentBoxSize[0];
console.log(elemSize.inlineSize); // a decimal
}
});
resizeObserver.observe(divElem);ResizeObserverSize: inlineSize property / notebook
ResizeObserverSize: inlineSize property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.