Retrieves the type of selection.
dhtml语法
[ sType = ] selection.type
DHTML可能的值
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.
DHTML代码范例
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.
是否符合公共标准
This property is defined in
World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .
Applies To