Retrieves the type of selection.
Syntax
[ sType = ] selection.type
Possible Values
sType | String that
receives one of the following values.none | No selection/insertion point. | text | Specifies a text selection. | control | Specifies a control selection, which enables dimension controls allowing the selected object to be resized. |
|
The property is read-only.
The property has no default value.
Remarks
The selection object is off the document object.
Example
This example uses the type property to create an alert that indicates the type of object selected by the user. If the user clicks the mouse pointer on the text "Some text", the alert reads "Text". If the user clicks the mouse pointer on the space to the right of the text, the alert reads "None".
<BODY onclick="alert(document.selection.type)">
Some text.
Standards Information
This property is defined in
World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .
Applies To