Javascript examples for jQuery:Selector
Jquery .select() on focus event
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.0.2.js"></script> <script type="text/javascript"> $(window).load(function(){/*from ww w .ja va 2s . com*/ $('#selectMe').on("click", function() { this.select(); }); $('#focusHim').click( function() { $('#selectMe').focus(); }); }); </script> </head> <body> <input id="selectMe" value="123"> <input type="button" id="focusHim" value="Im working fine"> </body> </html>