jquery select() method
Translation results:
select
UK[sɪˈlekt] US[sɪˈlɛkt]
vt.Select; select; select
adj. Selected; select come out; be selective;
jquery select() methodsyntax
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() methodexample
<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
Popular Recommendations
- BingX Restores Select Crypto Withdrawals After $52M Hack
- Tesla Robotaxi reveal to go ahead on October 10 as invitations go out to select shareholders
- CSS new property Field-sizing can make input, textarea and select adapt to their content
- Deal | Valve puts select Steam Deck models on clearance - 64 GB LCD model for $296.65 and 512 GB LCD model for $336.75