This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

detach

Summary

Removes or detaches a Range object and associated resources form a document.

Method of dom/Rangedom/Range

Syntax

var result = range.detach();

Return Value

Returns an object of type NumberNumber

Type: HRESULT

This method can return one of these values.

Return codeDescription
S_OKThe operation completed successfully.
InvalidStateErrorIf detach has been invoked on the object.

Examples

var range = document.createRange();

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

Syntax

Standards information

Attributions