jQuery Event - select() Method

Example

Add text after the text field to display the prompt text:

$("input").select(function(){
  $("input").after(" Text marked!");
});

Try it yourself

Definition and Usage

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

The select() method triggers the select event or specifies the function to be executed when the select event occurs.

Trigger the select event

Syntax

$().select()

Try it yourself

Bind the function to the select event

Syntax

$().select(function)
Parameter Description
function Optional. Specifies the function to be executed when a select event occurs.

Try it yourself