2 Demos of Using jQuery select Method

jQuery select

As some text is selected inside a text box or textarea of your web page, the jQuery select event occurs. You can use the jQuery select method to perform some action as the select event occurs.

Syntax of using select method

The simple syntax of using the select jQuery method is:

$(“selector”).select(function());

A select method example

This example shows as the select event occurs inside a text box, an alert will be shown by using the select method. For the select event to occur, select some text inside the text field.

jQuery select

Experience this example online

Example of select method in textarea

The following example shows select method triggering an alert as the select event occurs inside textarea field by using the select method of jQuery. For the select event to happen, select some text inside the textarea.

jQuery select textarea

Experience this example online

Further Reading: jQuery slide | jQuery events