title: Iterate into an array of elements
body: <p>I found this problem, it looks simple but I can't find any solution for this. I have an array of elements like below:</p>
  
  <pre><code>&lt;input type="text" name="subTotal[]"/&gt;
  &lt;input type="text" name="subTotal[]"/&gt;
  &lt;input type="text" name="subTotal[]"/&gt;
  &lt;input type="text" name="subTotal[]"/&gt;
  </code></pre>
  
  <p>Using jquery, I'd like to count the total from that four subTotal. The count will be triggered when the value of that subTotal is changed. I tried it like below, but it doesn't work:</p>
  
  <pre><code>var totalPrice = 0;
  $('input[name="subTotal"]').each( function( key, value ) {
      totalPrice += value;
      alert(totalPrice);
  });
  </code></pre>
  
  <p>Any solutions for this?</p>