Best way to collect all "visible" form elements with jQuery that don't have a specific class?
<p>I'm trying to re-assign a new tab-index on a given form. To do this I want to exclude any form elements that are invisible (not visible) -- and also exclude any form elements that possess a specific class (".offscreen").</p>

<p>I'm trying this method -- but, it's not working (and is perhaps not the most efficient method).</p>

<pre><code>function reassignTabOrders() {
    var tabindex = 1;
    $j('input,select,textarea').not('.offscreen').each(function() {
        var $input = $j(this);
        if ($input.is(':visible')) {
            $input.attr("tabindex", tabindex);
            tabindex++;
        }
    });
};
</code></pre>

<p>Any ideas?</p>
