jQuery: Focus the first input of a text field
If you have forms around your site (logins, registrations, etc), you might want to automatically focus those fields so the user has less clicking around to do. We want to do this unobtrusively, and don’t want to focus it if the field already has data in it (editing existing forms). Here’s the jQuery code to pull it off: