This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The Range() constructor returns a newly created Range object whose start and end is the global Document object.


range = new Range()


range = new Range();
endNode = document.getElementsByTagName("p").item(3);
endOffset = document.getElementsByTagName("p").item(3).childNodes.length;


Specification Status Comment
The definition of 'Range.Range()' in that specification.
Living Standard Initial definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes Yes24 No15 Yes
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes Yes2415 Yes ?

See also


Document Tags and Contributors

Contributors to this page: fscholz, bethge, teoli, jsx, kscarfone, Sheppy
Last updated by: fscholz,