selection Object--------------------------------------------------------------------------------Represents the active selection, which is a highlighted block of text, and/or other elements in the document on which a user or a script can carry out some action.ResYou typically use the selection object as input from the user to identify which portion of the document to act on, or as output to the user to show the results of an action. Users and scripts can create selections. Users create selections by dragging the mouse over a portion of the document. Scripts create selections by calling the select method on a text range or similar object. To retrieve the active selection, apply the selection keyword to the document object. To carry out work on a selection, create a text range object from the selection using the createRange method. A document can have only one selection at a time. The selection has a type that determines whether it is empty or contains a block of text and/or elements. Although an empty selection contains nothing, you can use it to  a position in the document.This object is available in script as of Microsoft® Internet Explorer 4.0.type Property--------------------------------------------------------------------------------Retrieves the type of selection. SyntaxHTML N/A 
Scripting [ sType = ] selection.type  Possible ValuessType String that specifies one of the following values: none No selection/insertion point.  
text Text selection.  
control Control selection. 
 The property is read-only with no default value. ResThe selection object is off the document object. ExampleThis example uses the type property to create an alert that indicates the type of object selected by the user. If the user drags the mouse pointer over the text "Some text", the alert reads "Text". If the user drags the mouse pointer over the space to the right of the text, the alert reads "None".Sample Code<BODY onclick="alert(document.selection.type)">
Some text.