enavu webdevmania tutsvalley psdestination
visit the enavu network
2 Comments Article Title Overlay Article Title

jQuery focus on first field trick

I have developed quite a few Web Apps and something that I have always found useful is the ability to pre-select the first input field on the page so it’s easy for the user to start filling out a form.

DZoneDiggDesign FloatDeliciousBlinklistRedditFacebookGoogle BuzzTwitterStumbleUponTumblrShare

I have developed quite a few Web Apps and something that I have always found useful is the ability to pre-select the first input field on the page so it’s easy for the user to start filling out a form.

So without further ado here is my little trick that will automatically work for any situation!

$(document).ready(function(){
	$("input[type=text]:first").focus();
});

Pretty nifty little “plugin”. I’m sure you guys can use this in all kinds of situations!

Enjoy!

Related posts:

  1. Automatic input field focus on page load
  2. Use HTML5 Placeholder Input Attribute Today using jQuery!
  3. Description text inside an input field
  4. Advanced jQuery Placeholder Plugin (cross-browser support)
  5. How To Create a jQuery Plugin

Did you absolutely LOVE this article... share it!

Comments

Leave your own!

Sponsors

freedcamp free project management

Popular Articles

fzilla file hosting