How do I listen for step up event for input type=“number”

前端 未结 5 1803
伪装坚强ぢ
伪装坚强ぢ 2021-01-12 11:45

I want to be able to listen to step UP (increment) and step down events with jQuery. (currently I can only understand how to lis

5条回答
  •  一整个雨季
    2021-01-12 12:11

    There's no specific event for up and down. Your closest bet is to use the change event. You might also take a look at the oninput event but I am not sure it is supported by all browsers:

    $('#myinput').on('input', function() {
    
    });
    

提交回复
热议问题