Created
April 15, 2014 10:45
-
-
Save alanhay/10722095 to your computer and use it in GitHub Desktop.
Revisions
-
alanhay created this gist
Apr 15, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ <script type="text/javascript"> $(document).ready(function() { // focus on the first visible and enabled input field or textarea $(":input:visible:enabled").each(function() { if (($(this).attr('type') == 'text') && ($(this).is('input'))){ $(this).focus(); return false; } if ($(this).is('textarea')){ $(this).focus(); return false; } }); }); </script>