title: How to use JQuery add number_field_tag's value
body: <p>Sorry i'm new to using Javascript in Rails.</p>
  
  <p>I have 4 number_field_tags.
  Whenever a user enters a number, it will sum the numbers of all 4 number_field_tag. I would like to know how can i do that.</p>
  
  <p>I've tried following this <a href="http://jsperf.com/jq-sum-elements-vs-raw-js" rel="nofollow">http://jsperf.com/jq-sum-elements-vs-raw-js</a> but I don't know how to call the function out.</p>
  
  <pre><code>&lt;td class="method2"&gt;
                  &lt;p&gt;Input the number of each base the primer should have&lt;/p&gt;
                  &lt;label&gt;Number of A :&lt;/label&gt;
                  &lt;%= number_field_tag(:no_A,nil, in:0...36) %&gt;&lt;br /&gt;
                  &lt;label&gt;Number of T :&lt;/label&gt;
                  &lt;%= number_field_tag(:no_T,nil, in:0...36) %&gt;&lt;br /&gt;
                  &lt;label&gt;Number of G :&lt;/label&gt;
                  &lt;%= number_field_tag(:no_G,nil, in:0...36) %&gt;&lt;br /&gt;
                  &lt;label&gt;Number of C :&lt;/label&gt;
                  &lt;%= number_field_tag(:no_C,nil, in:0...36) %&gt;&lt;br /&gt;
                  Total bases:&lt;span&gt;&lt;/span&gt;
  &lt;/td&gt;   
  </code></pre>
  
  <p>How can i show the current Total bases ? </p>