Javascript examples for jQuery Method and Property:focus
focus() function with function
<html> <head> <script src="https://code.jquery.com/jquery-2.1.4.js"></script> </head> //from ww w .j av a 2 s . c om <body> <input type="text" id="textid"> <script> jQuery(function( $ ){ $('#textid').focus(function() { console.log('Function is focused.'); }); }); </script> </body> </html>