Event.SELECT

JavaScript 1.0+ Nav2+, Opera3+ Syntax

Event.SELECT

Description

The SELECT property of the Event object is used by text objects and select-box form elements to indicate when an element is selected by the user.

Example

Listing 7.237 shows how the SELECT event can be used to determine which form object has been selected. When some text in the textarea is selected, the SELECT event is invoked. The document will then capture the event and call the handleSelect() function, which informs the user that the SELECT event occurred.

Listing 7.237 Using the SELECT Property
 <html> <head> <title>Example of Event.SELECT</title> </head> <body> <script language="JavaScript"> <!--Hide // sets up the window to capture SELECT events document.captureEvents(Event.SELECT); ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.