title: calculating total of 2 input fields in jQuery
body: <p>I have this HTML form:</p>
  
  <pre><code>&lt;div&gt;
      Amount 1: &lt;input id="amount1" type="text" /&gt;
      &lt;br&gt;
      Amount 2: &lt;input id="amount2" type="text" value="0.00"&gt;
      &lt;br&gt;
      &lt;span id="result"&gt;&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And this Jquery code:</p>
  
  <pre><code>$("#amount1").keyup(calc);
  $("#amount2").keyup(calc);
  function calc() {
    $('#result').val(
      parseInt($('#amount1').val(), 10) + parseInt($("#amount2").val(), 10)
    );
  }
  </code></pre>
  
  <p>What I'm trying to do is simply calculating and displaying amount1+amount2 when someone inputs numbers into the forms. Note that amount1 is 0.00 by default.</p>
  
  <p>When I run it, it doesn't calculate anything. What am I doing wrong here?</p>