class js.html.Range

Available on js

The Range object represents a fragment of a document that can contain nodes and parts of text nodes in a given document.

A range can be created using the Document.createRange  method of the Document  object. Range objects can also be retrieved by using the Selection.getRangeAt  method of the Selection  object.



Documentation for this class was provided by MDN.

Class Fields

static var END_TO_END:Int

static var END_TO_START:Int

static var NODE_AFTER:Int

static var NODE_BEFORE:Int

static var NODE_INSIDE:Int

static var START_TO_END:Int

static var START_TO_START:Int

Instance Fields

var collapsed:Bool

Returns a boolean indicating whether the range's start and end points are at the same position. Getter throws DOMException.

var commonAncestorContainer:Node

Returns the deepest Node  that contains the startContainer and endContainer Nodes. Getter throws DOMException.

var endContainer:Node

Returns the Node  within which the Range ends. Getter throws DOMException.

var endOffset:Int

Returns a number representing where in the endContainer the Range ends. Getter throws DOMException.

var startContainer:Node

Returns the Node  within which the Range starts. Getter throws DOMException.

var startOffset:Int

Returns a number representing where in the startContainer the Range starts. Getter throws DOMException.

function cloneRange():Range

function collapse(toStart:Bool):Void

function compareBoundaryPoints(how:Int, sourceRange:Range):Int

function compareNode(refNode:Node):Int

function comparePoint(refNode:Node, offset:Int):Int

function deleteContents():Void

function detach():Void

function expand(unit:String):Void

function insertNode(newNode:Node):Void

function intersectsNode(refNode:Node):Bool

function isPointInRange(refNode:Node, offset:Int):Bool

function selectNode(refNode:Node):Void

function selectNodeContents(refNode:Node):Void

function setEnd(refNode:Node, offset:Int):Void

function setEndAfter(refNode:Node):Void

function setEndBefore(refNode:Node):Void

function setStart(refNode:Node, offset:Int):Void

function setStartAfter(refNode:Node):Void

function setStartBefore(refNode:Node):Void

function surroundContents(newParent:Node):Void

function toString():String