Adding input values using jquery
===

I'm trying to make a slot machine and im new to programming, so this will probably be a easy fix for people. 

When i try this 

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


    var winnings = Number(bet) + Number(money);
    $('#money').val(winnings);

it only lets me bet the value of the input which is 10

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.


heres my html 

    <div id="betbox">
    <button id="bet">Bet</button>
    <input type="number" id="bet$" name="bet$" value="10" />
    </div>
        
    <div id="moneybox">
    <input type="text" id="money" name="money" value="100" />
    </div>



