据我所知,我只能使用 change 事件,但它仅在我停止增加/减少数字输入时触发,而不是在执行的每一步时触发。
有什么办法可以做到这一点吗?在 native javascript 或 jQuery 上。
最佳答案
使用input event :(因为无论如何 support 比 input type number 更好)
$('input[type=number]').on('input', function(){
console.log(this.value);
});
-jsFiddle-
关于javascript - 输入号码 HTML5 : is there an event which triggers on every step?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33937588/