I have an input tag and I want to take its value and put it in a span after a simple calculation. I did it but the value update only when the user hit the "Enter" button. Is there any way to do it dynamicaly? Without pushing the button.
<div class="col-sm-6 col-lg-6 col-md-6">
Number:<input id="number" type="int" onchange="updateInput(this.value)">
</div>
<div class="col-sm-6 col-lg-6 col-md-6">
Total <span id="result"></span>
</div>
<script type="text/javascript">
function updateInput(ish){
document.getElementById("result").innerHTML = ish*0.05
}
</script>