Selection

external class Selection(source)

A Selection object represents the range of text selected by the user or the current position of the caret. To obtain a Selection object for examination or modification, call Window.getSelection().

MDN Reference

Properties

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

Functions

Link copied to clipboard
Link copied to clipboard
fun collapse(node: Node?, offset: Int = definedExternally)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun containsNode(node: Node, allowPartialContainment: Boolean = definedExternally): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun extend(node: Node, offset: Int = definedExternally)
Link copied to clipboard
Link copied to clipboard
fun modify(alter: String = definedExternally, direction: String = definedExternally, granularity: String = definedExternally)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun setBaseAndExtent(anchorNode: Node, anchorOffset: Int, focusNode: Node, focusOffset: Int)
Link copied to clipboard
fun setPosition(node: Node?, offset: Int = definedExternally)