W3cubDocs

/DOM

Range.detach

The Range.detach() method does nothing. It used to disable the Range object and enable the browser to release associated resources. The method has been kept for compatibility.

Syntax

range.detach();

Example

var range = document.createRange();

range.selectNode(document.getElementsByTagName("div").item(0));
range.detach();

Specifications

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support Yes
Yes
Since April 2014 this method is a no-op in Chrome.
Yes 4 — 15
4 — 15
Starting in Firefox 15.0, this method is a no-op and has no effect.
9 9 Yes
Yes
Since August 2015 this method is a no-op in WebKit-based browsers.
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support Yes Yes Yes 4 — 15
4 — 15
Starting in Firefox 15.0, this method is a no-op and has no effect.
Yes Yes
Yes
Since August 2015 this method is a no-op in WebKit-based browsers.
?

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Range/detach