It\'s fairly straightforward. I want to set focus to the first enabled and not hidden control on the page.
For a textbox, I have
$(\"input[type=\'t
$(':input:enabled:visible:first').focus();
Try this:
$("input[type='text']:enabled","another selector","another selector").first().focus();
As an extension of Jordan's answer
$(':input:enabled:visible:not([readonly]):first').focus();
This one also excludes readonly inputs
This is a little more comprehensive:
$('form :input:text:visible:not(input[class*=filter]):first').focus();
Lamen: Focus the cursor in the first text input in a form that is visible, but if it use the class named "filter", ignore it!