How to wireup an event that adds numeric html input values for a slots game.
<p>I'm trying to make a slot machine and im new to programming, so this will probably be a easy fix for people. </p>

<p>When i try this </p>

<pre><code>var money = document.getElementsByName('money')[0].value;
var bet = document.getElementsByName('bet$')[0].value;


var winnings = Number(bet) + Number(money);
$('#money').val(winnings);
</code></pre>

<p>it only lets me bet the value of the input which is 10</p>

<p>I want to have the current bet to be added to the current money and then i  want the sum to be displayed in the money input box.</p>

<p>heres my html </p>

<pre><code>&lt;div id="betbox"&gt;
&lt;button id="bet"&gt;Bet&lt;/button&gt;
&lt;input type="number" id="bet$" name="bet$" value="10" /&gt;
&lt;/div&gt;

&lt;div id="moneybox"&gt;
&lt;input type="text" id="money" name="money" value="100" /&gt;
&lt;/div&gt;
</code></pre>
