Vinny & Jess.com
Facebook Fan Page
Follow us on Twitter

Setting focus on first HTML form element with jQuery

May 28th, 2009 at 10:23 am by Vinny

Here’s a simple, universal solution that will work for any page assuming you want focus on the very first input element:

1
2
3
4
5
<script type="text/javascript">
   $(document).ready(function() {
      $(':input:first').focus();
   });
</script>

form, html, javascript, jquery

There are more solutions available, and if you’re interested, please visit this page by Blake Schwendiman

Please Comment

Expand All Months » September 2009  (0)
Detailed Monthly Archive
August 2009  (0)
Detailed Monthly Archive
July 2009  (0)
Detailed Monthly Archive
June 2009  (0)
Detailed Monthly Archive
May 2009  (0)
Detailed Monthly Archive
April 2009  (0)
Detailed Monthly Archive
February 2009  (0)
Detailed Monthly Archive
January 2009  (0)
Detailed Monthly Archive

Plugin by GeekWithLaptop.com