class Range extends Object
The Range interface represents a fragment of a document that can contain nodes and parts of text nodes.
A range can be created using the createRange() method of the Document object. Range objects can also be retrieved by using the getRangeAt() method of the Selection object or the caretRangeAtPoint() method of the Document object.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/Range
- Alphabetic
- By Inheritance
- Range
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Range()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
cloneContents(): DocumentFragment
Returns a DocumentFragment copying the nodes of a Range.
-
def
cloneRange(): Range
Returns a Range object with boundary points identical to the cloned Range.
-
def
collapse(toStart: Boolean = js.native): Unit
Collapses the Range to one of its boundary points.
Collapses the Range to one of its boundary points.
- toStart
Optional: A boolean value: true collapses the Range to its start, false to its end. If omitted, it defaults to false
-
def
collapsed: Boolean
Returns a Boolean indicating whether the range's start and end points are at the same position.
-
def
commonAncestorContainer: Node
Returns the deepest Node that contains the startContainer and endContainer nodes.
-
def
compareBoundaryPoints(how: RangeType, sourceRange: Range): Int
Compares the boundary points of the Range with another Range.
Compares the boundary points of the Range with another Range.
- how
A constant describing the comparison method:
- sourceRange
A Range to compare boundary points with the range.
- returns
A number, -1, 0, or 1, indicating whether the corresponding boundary-point of the Range is respectively before, equal to, or after the corresponding boundary-point of sourceRange.
-
def
deleteContents(): Unit
Removes the contents of a Range from the Document.
-
def
detach(): Unit
Releases the Range from use to improve performance.
-
def
endContainer: Node
Returns the Node within which the Range ends.
-
def
endOffset: Int
Returns a number representing where in the endContainer the Range ends.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
extractContents(): DocumentFragment
Moves contents of a Range from the document tree into a DocumentFragment.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
insertNode(newNode: Node): Unit
Insert a Node at the start of a Range.
Insert a Node at the start of a Range.
- newNode
The Node to insert at the start of the range.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
selectNode(referenceNode: Node): Unit
Sets the Range to contain the Node and its contents.
Sets the Range to contain the Node and its contents.
- referenceNode
The Node to select within a Range.
-
def
selectNodeContents(referenceNode: Node): Unit
Sets the Range to contain the contents of a Node.
Sets the Range to contain the contents of a Node.
- referenceNode
The Node whose contents will be selected within a Range.
-
def
setEnd(endNode: Node, endOffset: Int): Unit
Sets the end position of a Range.
Sets the end position of a Range.
- endNode
The Node where the Range should end.
- endOffset
An integer greater than or equal to zero representing the offset for the end of the Range from the start of endNode.
-
def
setEndAfter(referenceNode: Node): Unit
Sets the end position of a Range relative to another Node.
Sets the end position of a Range relative to another Node.
- referenceNode
The Node to end the Range after.
-
def
setEndBefore(referenceNode: Node): Unit
Sets the end position of a Range relative to another Node.
Sets the end position of a Range relative to another Node.
- referenceNode
The Node to end the Range before.
-
def
setStart(startNode: Node, startOffset: Int): Unit
Sets the start position of a Range.
Sets the start position of a Range.
- startNode
The Node where the Range should start.
- startOffset
An integer greater than or equal to zero representing the offset for the start of the Range from the start of startNode.
-
def
setStartAfter(referenceNode: Node): Unit
Sets the start position of a Range relative to another Node.
Sets the start position of a Range relative to another Node.
- referenceNode
The Node to start the Range after.
-
def
setStartBefore(referenceNode: Node): Unit
Sets the start position of a Range relative to another Node.
Sets the start position of a Range relative to another Node.
- referenceNode
The Node before which the Range should start.
-
def
startContainer: Node
Returns the Node within which the Range starts.
-
def
startOffset: Int
Returns a number representing where in the startContainer the Range starts.
-
def
surroundContents(newNode: Node): Unit
Moves content of a Range into a new Node.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )