W3cubDocs

/Web APIs

ResizeObserver: disconnect() method

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

Syntax

js

disconnect()

Parameters

None.

Return value

None (undefined).

Exceptions

None.

Examples

js

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

Specifications

Browser compatibility

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

© 2005–2023 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