function(){ var tabIndex = 1; $("input[type='text']").each(function(){ this.tabIndex = tabIndex; tabIndex++; }) }