I'm working on a form, and I want to get in real time the current value of an input field of type number, as this one :
$(":input").bind('keyup mouseup', function () {
var coins = $("#coins").val();
$("#reward").text(coins);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input id="coins" type="number" name="coins" value="1" max="999" min="1">
<p id="potential">Potential reward : <b id="reward"></b></p>
But nothing happen when I run it. It says that the value of coins is null. I don't know what I am doing wrong... Anyone could help ?