W3cubDocs

/Web APIs

ResizeObserver: disconnect() method

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2020⁩.

The disconnect() method of the ResizeObserver interface unobserves all observed Element or SVGElement targets.

Syntax

disconnect()

Parameters

None.

Return value

None (undefined).

Exceptions

None.

Examples

btn.addEventListener("click", () => {
  resizeObserver.disconnect();
});

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
disconnect 64 79 69 51 13.1 64 79 47 13.4 9.0 64 13.4

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/disconnect