onselect event
Complete Event Object Reference
Definition and Usage
The onselect event occurs when text is selected in a text or textarea field.
Syntax
onselect="SomeJavaScriptCode"
|
Parameter |
Description |
SomeJavaScriptCode |
Required. Specifies a JavaScript to be executed when the
event occurs. |
Supported by the following HTML tags:
<input type="text">, <textarea> |
Supported by the following JavaScript objects:
Example
In this example an alert box will be displayed if some of the text is
selected:
<form>
Select text: <input type="text" value="Hello world!"
onselect="alert('You have selected some of the text.')">
<br /><br />
Select text: <textarea cols="20" rows="5"
onselect="alert('You have selected some of the text.')">
Hello world!</textarea>
</form>
|
The output of the code above will be:
Try-It-Yourself Demos
onselect
How to use onselect.
Complete Event Object Reference
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|