Javascript examples for jQuery Method and Property:select
trigger the select event for the selected elements:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("input").select(function(){ $("input").after(" Text marked!"); });/*from www.j a v a 2 s. c om*/ $("button").click(function(){ $("input").select(); }); }); </script> </head> <body> <input type="text" value="Hello World"> <p>Select some text inside the input field.</p> <button>Trigger the select event</button> </body> </html>