Not TestedTesting not done, may not work properly
DOM & HTML

Resize Observer

Observe changes to an Element's content or border box dimensions.

Checking support...
Advertisement

Interactive Input Workspace

Ready for input

Web API Execution Output

Result output will be displayed here after processing...

Native JavaScript Code Example (Zero Libraries)

const observer = new ResizeObserver(entries => {
  for (let entry of entries) console.log(entry.contentRect.width);
});
observer.observe(document.body);

About the Resize Observer Web API

ResizeObserver reports changes to the dimensions of an Element's content box or border box.

Specification:W3C & WHATWG Web API Standard
Sponsored Content