title: jQuery iterate through elements
body: <p>I have the following HTML.</p>
  
  <pre><code>&lt;div id="price_list"&gt;
   &lt;input type="text" value="100" class="input_price" /&gt;
   &lt;input type="text" value="256" class="input_price" /&gt;
   &lt;input type="text" value="500" class="input_price" /&gt;
   &lt;input type="text" value="04.26" class="input_price" /&gt;
   &lt;input type="text" value="156" class="input_price" /&gt;
   &lt;input type="text" value="052" class="input_price" /&gt;
   &lt;input type="text" value="692" class="input_price" /&gt;
   &lt;input type="text" value="25.36" class="input_price" /&gt;
   &lt;input type="text" value="10.56" class="input_price" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>What is the best way to get the SUM of values of the elements having class <code>input_price</code>?</p>
  
  <p>Please note that I am concerned about the performance. My actual HTML is bit more complex (sometimes I have thousands of elements). I tried using <code>.each()</code> but sometimes my browser gets stuck. So that the question can be modified to "What is the best way to iterate through elements TO GET some data?"</p>
  
  <p>My try:</p>
  
  <pre><code>var total = 0;
  
  $(".input_price").each(function(){
    total+=parseFloat($(this).val());    
  });
  </code></pre>