Programmer's Guide > Interfaces > ADocument interface > textSelection attribute
  
textSelection attribute
A DOM Range indicating the current text selection. If there is no text selection, the value will be the same as insertionPoint.
If the text selection is set to a collapsed range, the selection is cleared. The insertion point is not changed.
textSelection
Access
read-write
Returns
Range
Set throws
DOMException
INVALID_STATE_ERR: Raised if the Range has already been detached.