Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML onselect Event Attribute

HTML onselect Event Attribute

HTML Event Attributes HTML Event Attributes

Example

When text in theelement is selected, execute JavaScript:

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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: , , , , and LinkedHashMap, among others.


Differences between HTML 4.01 and HTML5

none.


Syntax

<

element

onselect="

script

">

HTML Event Attributes HTML Event Attributes