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 compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
detach
1
Starting in Chrome 37, this method is a no-op and has no effect.
12
1-15
Starting in Firefox 15.0, this method is a no-op and has no effect.
9
9
Starting in Opera 24, this method is a no-op and has no effect.
1
Since August 2015 this method is a no-op in WebKit-based browsers.
1
Starting in WebView 37, this method is a no-op and has no effect.
18
Starting in Chrome 37, this method is a no-op and has no effect.
4-15
Starting in Firefox 15.0, this method is a no-op and has no effect.
10.1
Starting in Opera 24, this method is a no-op and has no effect.
1
Since August 2015 this method is a no-op in WebKit-based browsers.
1.0
Starting in Samsung Internet 3.0, this method is a no-op and has no effect.

See also

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