HTML onselect Event Attribute
Example
When text in theelement is selected, execute JavaScript:
Try it »
Browser support





All major browsers support the onselect event attribute
Definition and Usage
The onselect attribute is triggered after the text of an element is selected.
The onselect attribute can be used with the following elements: , , ,
Differences between HTML 4.01 and HTML5
none.
Syntax
<
element
onselect="
script
">
HTML Event Attributes