Reputation: 92581
I am using the html5 input type="number"
. I want to monitor this input for change, but:
.keyup
,.change
.How can I monitor it so I catch all cases where it's value is changed?
Upvotes: 3
Views: 721
Reputation: 92581
After looking at some of the question's on this site and using the mousewheel plugin I have got
$('#spinbox').bind('click change keyup mousewheel', function() {
//10 ms timeout is for mousewheel otherwise you get the previous value
var box = this;
setTimeout(function() {console.log($(box).val());}, 10);
});
So you need to monitor it for
Upvotes: 1
Reputation: 224857
See: HTML5 number spinbox controls not triggering a change event?
You might use both oninput
and onkeydown
for compatibility.
Upvotes: 0