简体   繁体   中英

Input number HTML5: is there an event which triggers on every step?

As far as I know, I can only use the change event for it, but it's only triggered when I stop increasing/decreasing the number input, not on each and every step taken.

Is there any way to do that? On native javascript or jQuery.

Use input event : (because anyway support is better than the one for input type number )

$('input[type=number]').on('input', function(){
    console.log(this.value);
});

-jsFiddle-

$("#number").on('keyup change', function(e){

});

Will work!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM