Javascript examples for jQuery:Selector
Select all string and focus when document is ready
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.3.js"></script> <script type="text/javascript"> $(window).load(function(){/*from ww w .j a v a2 s . com*/ $(document).ready(function () { $("#myTextBox").focus().select(); }); }); </script> </head> <body> Name: <input id="myTextBox" type="text" class="myText" value="First Name"> </body> </html>