Easy Tutorial
❮ Att Col Char Canvas Createradialgradient ❯

HTML onselect Event Attribute

HTML Event Attributes

Example

Execute JavaScript after selecting text in an <input> element:


Browser Support

All major browsers support the onselect event attribute.


Definition and Usage

The onselect attribute is triggered after text is selected in an element.

The onselect attribute can be used with the following elements: <input type="file">, <input type="password">, <input type="text">, <keygen>, and <textarea>.


Differences Between HTML 4.01 and HTML5

None.


Syntax

Attribute Values

Value Description
script Specifies the script to run when the onselect event is triggered.

❮ Att Col Char Canvas Createradialgradient ❯