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

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes1 Yes4 — 15299 Yes3
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes Yes4 — 152 Yes Yes3 ?

1. Since April 2014 this method is a no-op in Chrome.

2. Starting in Firefox 15.0, this method is a no-op and has no effect.

3. Since August 2015 this method is a no-op in WebKit-based browsers.

See also

Document Tags and Contributors

Tags: 
Last updated by: fscholz,