ExampleExecute a JavaScript after some text has been selected in an <input> element: |
Browser Support |
1. Definition and Usage
The onselect attribute fires after some text has been selected in an element.
The onselect attribute can be used within: <input type="file">, <input type="password">, <input type="text">, <keygen>, and <textarea>.
2. Differences Between HTML 4.01 and HTML5
None.
3. Syntax
<element onselect="script">
4. Attribute Values
Value | Description |
---|---|
script | The script to be run on onselect |