Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Focus first form input field using jQuery
function focusFirstInput($root) {
$(':input', $root).not('[type="hidden"], button').first().focus();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment