Range

open external class Range : AbstractRange(source)

A fragment of a document that can contain nodes and parts of text nodes.

MDN Reference

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed interface CompareMethod

Properties

Link copied to clipboard

Returns true if range is collapsed, and false otherwise.

Link copied to clipboard

Returns the node, furthest away from the document, that is an ancestor of both range's start node and end node.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns range's end node.

Link copied to clipboard

Returns range's end offset.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns range's start node.

Link copied to clipboard

Returns range's start offset.

Functions

Link copied to clipboard
Link copied to clipboard
fun collapse(toStart: Boolean = definedExternally)
Link copied to clipboard
Link copied to clipboard
fun comparePoint(node: Node, offset: Int): Short

Returns −1 if the point is before the range, 0 if the point is in the range, and 1 if the point is after the range.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns whether range intersects node.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun setEnd(node: Node, offset: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun setStart(node: Node, offset: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard