jQuery set var where n is ID for tabindex order?
<p>How to combine the two scripts below, into one, with the goal to get a script to generate a tabindex order feature for input/select fields in a form (where 1, 7, 3 are ID (#) of fields)?</p>

<pre><code>$(function(){
var tabindex = 1;
$('input,select').each(function() {
    if (this.type != "hidden") {
        var $input = $(this);
        $input.attr("tabindex", tabindex);
        tabindex++;
    }
});
});


$(function () {
var tab_order_positions = [1, 7, 3],
tab_order = 0;
for (var i = 0, _len = tab_order_positions.length; i &lt; _len; i++) {
    $('#input_' + tab_order_positions[i]).attr('tabindex', ++tab_order);
}
});
</code></pre>
