1.9.9.2
Prysm
Selection Interface Reference

The navigator of the view. More...

Public Member Functions

void removeAllRanges ()
 Removes all ranges from the selection. More...
 
void empty ()
 Clear the selection. This is an alias for removeAllRanges(). More...
 
void setBaseAndExtent (Node anchorNode, unsigned long anchorOffset, Node focusNode, unsigned long focusOffset)
 Sets the selection to be a range including all or parts of two specified DOM nodes, and any content located between them. More...
 
DOMString toString ()
 Returns a string currently being represented by the selection object, i.e. the currently selected text. More...
 

Public Attributes

readonly attribute Node anchorNode
 Returns the Node in which the selection begins. Can return null if selection never existed in the document. More...
 
readonly attribute unsigned long anchorOffset
 Returns a number representing the offset of the selection's anchor within the anchorNode. More...
 
readonly attribute Node focusNode
 Returns the Node in which the selection ends. Can return null if selection never existed in the document. More...
 
readonly attribute unsigned long focusOffset
 Returns a number representing the offset of the selection's anchor within the focusNode. More...
 

Detailed Description

The navigator of the view.

Member Function Documentation

◆ empty()

void Selection::empty ( )

Clear the selection. This is an alias for removeAllRanges().

◆ removeAllRanges()

void Selection::removeAllRanges ( )

Removes all ranges from the selection.

◆ setBaseAndExtent()

void Selection::setBaseAndExtent ( Node  anchorNode,
unsigned long  anchorOffset,
Node  focusNode,
unsigned long  focusOffset 
)

Sets the selection to be a range including all or parts of two specified DOM nodes, and any content located between them.

◆ toString()

DOMString Selection::toString ( )

Returns a string currently being represented by the selection object, i.e. the currently selected text.

Member Data Documentation

◆ anchorNode

readonly attribute Node Selection::anchorNode

Returns the Node in which the selection begins. Can return null if selection never existed in the document.

◆ anchorOffset

readonly attribute unsigned long Selection::anchorOffset

Returns a number representing the offset of the selection's anchor within the anchorNode.

◆ focusNode

readonly attribute Node Selection::focusNode

Returns the Node in which the selection ends. Can return null if selection never existed in the document.

◆ focusOffset

readonly attribute unsigned long Selection::focusOffset

Returns a number representing the offset of the selection's anchor within the focusNode.