How to improve performance..?
<pre><code>function removeTds() {
    var elements = $('#goldBarList tr:not(:eq(0))').filter(':has(:checkbox:checked):lt(50)');
    var count = elements.length;
    elements.each(function() {
        grossWeightTotal = grossWeightTotal - $('#goldBarList tr:eq(' + $(this).index() + ') td:eq(8)').text();
        netWeightTotal = netWeightTotal - $('#goldBarList tr:eq(' + $(this).index() + ') td:eq(9)').text();
        fineOunceTotal = fineOunceTotal - $('#goldBarList tr:eq(' + $(this).index() + ') td:eq(10)').text();
    });
    elements.remove();
    if(count === 50) window.setTimeout(removeTds, 1);
}
removeTds();
</code></pre>

<p>The above code results in the "stop running this script?" prompt. I have 4000 records.</p>
