Published on Tuesday, September 13, 2011 by Jason in jQuery
This code is an easy way to set the tab index of your form elements using jQuery.
// Set tab index on form elements
var tabindex = 1;
$("input, textarea, select").each(function(){
if (this.type != "hidden") {
var $input = $(this);
$input.attr("tabindex", tabindex);
tabindex++;
}
});