English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The select() method triggers the select event or attaches a function to be executed when the select event occurs.
A select event occurs when the user selects some text (such as <input>, <textarea>).
Trigger the selection event of the selected element:
$.select(selector)
Attach a function to the select event:
$.select(selector).select(function)
Remind message when text is selected in the <input> field:
$("input").select(function() { alert('Selected!!!'); });Test and see‹/›
Trigger the select event of the <input> field:
$("button").click(function(){ $("input").select(); });Test and see‹/›
Parameter | Description |
---|---|
function | Function executed each time a select event is triggered |