Easy Tutorial
❮ Sel Onlyoftype Css Scrolltop ❯

jQuery select() Method

jQuery Event Methods

Example

Display a message when text in a text field is selected:

$("input").select(function(){ alert("Text has been selected!"); });

Definition and Usage

The select event occurs when text in a textarea or a text-type input element is selected (marked).

The select() method triggers the select event, or specifies a function to run when a select event occurs.


Syntax

Trigger the select event for the selected elements:

Attach a function to the select event:

Parameter Description
function Optional. Specifies the function to run when the select event is triggered.

jQuery Event Methods

❮ Sel Onlyoftype Css Scrolltop ❯