Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ulixee
GitHub Repository: ulixee/secret-agent
Path: blob/main/website/awaited-dom/AbstractRange.md
1028 views

AwaitedDOM / AbstractRange

The AbstractRange abstract interface is the base class upon which all DOM range types are defined. A range is an object that indicates the start and end points of a section of content within the document.
As an abstract interface, you will not directly instantiate an object of type AbstractRange. Instead, you will use the Range or StaticRange interfaces. To understand the difference between those two interfaces, and how to choose which is appropriate for your needs.

Properties

.collapsed
W3C {#collapsed}

A Boolean value which is true if the range is collapsed. A collapsed range is one whose start position and end position are the same, resulting in a zero-character-long range.

Type: Promise<boolean>

.endContainer
W3C {#endContainer}

The DOM Node in which the end of the range, as specified by the endOffset property, is located.

Type: SuperNode

.endOffset
W3C {#endOffset}

An integer value indicating the offset, in characters, from the beginning of the node's contents to the beginning of the range represented by the range object. This value must be less than the length of the endContainer node.

Type: Promise<number>

.startContainer
W3C {#startContainer}

The DOM Node in which the beginning of the range, as specified by the startOffset property, is located.

Type: SuperNode

.startOffset
W3C {#startOffset}

An integer value indicating the offset, in characters, from the beginning of the node's contents to the last character of the contents referred to  by the range object. This value must be less than the length of the node indicated in startContainer.

Type: Promise<number>