title: Run a long loop every time text changes
body: <p>I have a table which has some empty textboxes. When the user enters value, the subtotal and total should change in real time. However my code is not working.</p>
  
  <p>Here's an attempt <a href="http://jsfiddle.net/Jht5j/" rel="nofollow">fiddle</a></p>
  
  <pre><code>$rows.each(function(index) {
              $rows.children("td").each(function() { 
                  qty = $("td:nth-child(2) input").val();
                  rate = $("td:nth-child(3) input").val();
                  amount = qty * rate;
                  subtotal = amount;
  
              });
  });
  </code></pre>
  
  <p>Also how to make this <strong>work with performance for a large table.</strong></p>