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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic support
Experimental
Chrome Full support 60Edge ? Firefox ? IE ? Opera Full support 47Safari Full support 10.1WebView Android Full support 60Chrome Android Full support 60Edge Mobile ? Firefox Android ? Opera Android Full support 47Safari iOS Full support 10.1Samsung Internet Android ?
StaticRange() constructor
Experimental
Chrome Full support 60Edge ? Firefox ? IE ? Opera Full support 47Safari ? WebView Android Full support 60Chrome Android Full support 60Edge Mobile ? Firefox Android ? Opera Android Full support 47Safari iOS ? Samsung Internet Android ?
startContainer
Experimental
Chrome Full support 60Edge ? Firefox ? IE ? Opera Full support 47Safari Full support 10.1WebView Android Full support 60Chrome Android Full support 60Edge Mobile ? Firefox Android ? Opera Android Full support 47Safari iOS Full support 10.1Samsung Internet Android ?
startOffset
Experimental
Chrome Full support 60Edge ? Firefox ? IE ? Opera Full support 47Safari Full support 10.1WebView Android Full support 60Chrome Android Full support 60Edge Mobile ? Firefox Android ? Opera Android Full support 47Safari iOS Full support 10.1Samsung Internet Android ?
endContainer
Experimental
Chrome Full support 60Edge ? Firefox ? IE ? Opera Full support 47Safari Full support 10.1WebView Android Full support 60Chrome Android Full support 60Edge Mobile ? Firefox Android ? Opera Android Full support 47Safari iOS Full support 10.1Samsung Internet Android ?
endOffset
Experimental
Chrome Full support 60Edge ? Firefox ? IE ? Opera Full support 47Safari Full support 10.1WebView Android Full support 60Chrome Android Full support 60Edge Mobile ? Firefox Android ? Opera Android Full support 47Safari iOS Full support 10.1Samsung Internet Android ?
collapsed
Experimental
Chrome Full support 60Edge ? Firefox ? IE ? Opera Full support 47Safari Full support 10.1WebView Android Full support 60Chrome Android Full support 60Edge Mobile ? Firefox Android ? Opera Android Full support 47Safari iOS Full support 10.1Samsung Internet Android ?
toRange
Experimental
Chrome Full support 60Edge ? Firefox ? IE ? Opera Full support 47Safari ? WebView Android Full support 60Chrome Android Full support 60Edge Mobile ? Firefox Android ? Opera Android Full support 47Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

Document Tags and Contributors

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