Home | Top | Website design | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.


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.

Members Table

The following table lists the members exposed by the selection object. Click a tab on the left to choose the type of member you want to view.

Attributes/Properties  
 
Attributes/Properties
Behaviors
Collections
Events
Methods
Property Description
type Retrieves the type of selection.
typeDetail Retrieves the name of the selection type.

Remarks

You 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 mark a position in the document.

This object is available in script as of Microsoft® Internet Explorer 4.0.

Standards Information

There is no public standard that applies to this object.

Applies To

Platform Version
Win16:
Win32:
Windows CE:
Unix:
Mac:
 
document

 

Home | Top | Website design | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.