title: Simple jquery sum
body: <p>I have unknown number of input fields, having class "add" I just wants to sum these with jquery, dont know where I am wrong.</p>
  
  <pre><code>&lt;input name="add" class="add" type="text"&gt;
  &lt;input name="add" class="add" type="text"&gt;
  &lt;input name="add" class="add" type="text"&gt;
  &lt;input name="add" class="add" type="text"&gt;
  
  &lt;input type="button" value="" onClick="add()" /&gt;
  </code></pre>
  
  <p>`</p>
  
  <pre><code>function add(){
          val = 0;
          $(".add").each(function() {      
              str = (parseInt(this.value))
              sum=str+str
          });
          alert (sum)
      }
  </code></pre>
  
  <p>`</p>