select
UK[sɪˈlekt] US[sɪˈlɛkt]
vt.Select; select; select
adj. Selected; select come out; be selective;
jquery select() method syntax
Function:When the text in the textarea or input element of text type is selected, the select event occurs. The select() method triggers a select event, or specifies a function to run when a select event occurs.
Trigger select event syntax: $(selector).select()
Bind the function to the select event syntax: $ (selector).select(function)
Parameters:
Parameters | Description |
function | Optional. Specifies the function to be run when a select event occurs. |
jquery select() method example
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("input").select(function(){ $("input").after(" Text marked!"); }); }); </script> </head> <body> <input type="text" name="FirstName" value="Hello World" /> <p>请试着选取输入域中的文本,看看会发生什么。</p> </body> </html>
Click the "Run instance" button to view the online instance