selectionselection*
*



Contents  *



Index  *Topic Contents
*Previous Topic: SELECT
*Next Topic: SMALL

selection

Description

Represents the active selection, a highlighted block of text, and/or other elements in the document upon which a user or a script can carry out some action. You typically use the selection object as input from the user identifying what portion of the document to act on, or as output to the user showing the results of an action.

Remarks

Users and scripts can both create selections. Users create selections by dragging the mouse over a portion of the document. Scripts create them by calling the select method on a text range or similar object. You can retrieve the active selection by applying the selection keyword to the document object. To carry out work on a selection, you can create a text range object from the selection by 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 contiguous block of consecutive text and/or elements. Although an empty selection contains nothing, it is useful for marking a position in the document.

Properties

type

Methods

clear, createRange, empty

Applies To

document


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.