Name
selection — NN n/a IE 4 DOM n/a
Synopsis
The selection object
represents zero or more characters that have been either explicitly
selected in a document by the user or selected under script control.
All actions on the content of a selection are done via a
TextRange object, which can be created from the
selection object (see the TextRange object).
TextRange and selection objects
are available in Navigator 4 only in the Win32 environment. The
selection object belongs to the
document object.
Navigator 4 offers script access to the text selected in a document
via the document.getSelection( ) method.
In all browsers, be aware that clicking on buttons deselects the
current text selection. Therefore, all scripted action involving
selections must be triggered by select events or functions invoked by
a timer (see the window.setTimeout( ) method
description in Chapter 11).
Object Model Reference
- IE
document.selection
Properties
|
|
Methods
|
|
|
|
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access