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

Specification Status Comment
DOM
The definition of 'Range.detach()' in that specification.
Living Standard No change.
Document Object Model (DOM) Level 2 Traversal and Range Specification
The definition of 'Range.detach()' in that specification.
Obsolete Initial specification.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
detachChrome Full support Yes
Notes
Full support Yes
Notes
Notes Since April 2014 this method is a no-op in Chrome.
Edge Full support 12Firefox No support 4 — 15
Notes
No support 4 — 15
Notes
Notes Starting in Firefox 15.0, this method is a no-op and has no effect.
IE Full support 9Opera Full support 9Safari Full support Yes
Notes
Full support Yes
Notes
Notes Since August 2015 this method is a no-op in WebKit-based browsers.
WebView Android Full support YesChrome Android Full support YesFirefox Android No support 4 — 15
Notes
No support 4 — 15
Notes
Notes Starting in Firefox 15.0, this method is a no-op and has no effect.
Opera Android Full support YesSafari iOS Full support Yes
Notes
Full support Yes
Notes
Notes Since August 2015 this method is a no-op in WebKit-based browsers.
Samsung Internet Android Full support Yes

Legend

Full support
Full support
No support
No support
See implementation notes.
See implementation notes.

See also