StaticRange

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

The StaticRange interface provides attributes that track the start and end position of a range, and a boolean attribute indicating whether the current range is collapsed into a single position.

Constructor

StaticRange.StaticRange()
Creates a new StaticRange object.

Properties

StaticRange.startContainer
Returns the start Node for the range.
StaticRange.startOffset
Returns the offset into the start node of the range's start position.
StaticRange.endContainer
Returns the end Node for the range.
StaticRange.endOffset
Returns the offset into the start node of the range's end position.
StaticRange.collapsed
Returns true if the range's start position and end position are the same.

Methods

StaticRange.toRange()
Converts the StaticRange object to a Range object.

Specifications

Specification Status Comment
DOM
The definition of 'StaticRange' in that specification.
Living Standard  
Static Range
The definition of 'StaticRange' in that specification.
Editor's Draft Initial definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support60 ? ? ?4710.1
StaticRange() constructor60 ? ? ?47 ?
startContainer60 ? ? ?4710.1
startOffset60 ? ? ?4710.1
endContainer60 ? ? ?4710.1
endOffset60 ? ? ?4710.1
collapsed60 ? ? ?4710.1
toRange60 ? ? ?47 ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support6060 ? ?4710.1 ?
StaticRange() constructor6060 ? ?47 ? ?
startContainer6060 ? ?4710.1 ?
startOffset6060 ? ?4710.1 ?
endContainer6060 ? ?4710.1 ?
endOffset6060 ? ?4710.1 ?
collapsed6060 ? ?4710.1 ?
toRange6060 ? ?47 ? ?

Document Tags and Contributors

Contributors to this page: mkato, fscholz, jpmedley
Last updated by: mkato,