To focus on a login input box with id 'login' on page startup, try:
$("#login").focus();
To following script can be used to trigger some action on focus of each input field in the form.
$("input").focus(function () {
$(this).next("span").css('display','inline').fadeOut(1000);
});
Use the following script to focus on first input field in the form.
ReplyDelete$("input[type='text']:enabled:first").focus();