Javascript addition
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8377410/addition-is-not-working-in-javascript">Addition is not working in JavaScript</a>  </p>
</blockquote>



<p>In an attempt to learn some java script, I'm trying to build a simple system that adds values when buttons are clicked.. </p>

<p>The following code works, but will only add the hardcoded value of <code>+100</code>, can anyone help me change this code so it adds the value nested in the <code>id="add"</code> button?</p>

<pre><code>&lt;html&gt;
  &lt;head&gt;
        &lt;title&gt;Input tutorial&lt;/title&gt;
        &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
        &lt;script language="javascript"&gt;
               $(function () {
    $("#add").click(function() {
    $("#total").val(parseInt($("#total").val()) + 100)
});
});
        &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
     &lt;input type="button" value="12" id="add"&gt;
     &lt;input type="button" value="14" id="total"&gt;

  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Any help would be great! Thank you.</p>
