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... | |
The navigator of the view.
void Selection::empty | ( | ) |
Clear the selection. This is an alias for removeAllRanges().
void Selection::removeAllRanges | ( | ) |
Removes all ranges from the selection.
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.
DOMString Selection::toString | ( | ) |
Returns a string currently being represented by the selection object, i.e. the currently selected text.
readonly attribute Node Selection::anchorNode |
Returns the Node in which the selection begins. Can return null if selection never existed in the document.
readonly attribute unsigned long Selection::anchorOffset |
Returns a number representing the offset of the selection's anchor within the anchorNode.
readonly attribute Node Selection::focusNode |
Returns the Node in which the selection ends. Can return null if selection never existed in the document.
readonly attribute unsigned long Selection::focusOffset |
Returns a number representing the offset of the selection's anchor within the focusNode.