HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> </head> <body> <h1>jQuery select() Method</h1> <input type="text" value="select me"> <button>Trigger select Event</button> <script> $(document).ready(function(){ $("input").select(function(){ alert("Input text selected"); }); $("button").click(function(){ $("input").select(); }); }); </script> </body> </html>
OUTPUT
×

Save as Private