Just a super simple javascript question, but i cannot find out how it works
Need to get script output to the input.
original script on http://jsfiddle.net/mYuRK/
Thanks!
var theTotal = 0;
$('button').click(function(){
theTotal = Number(theTotal) + Number($(this).val());
$('.tussenstand').text("Total: "+theTotal);
});
$('.tussenstand').text("Total: "+theTotal);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input id="tussenstand">
<button value="1">1</button>
<button value="2">2</button>
<button value="4">4</button>
<button value="6">6</button>
#tussenstandinstead of.tussenstandas selector.