onchange event for input type=“number”

前端 未结 10 1780
梦如初夏
梦如初夏 2020-12-02 22:11

How can I handle an onchange for ? I can\'t do a keyup or keydown, be

10条回答
  •  Happy的楠姐
    2020-12-02 22:17

    The oninput event (.bind('input', fn)) covers any changes from keystrokes to arrow clicks and keyboard/mouse paste, but is not supported in IE <9.

    jQuery(function($) {
      $('#mirror').text($('#alice').val());
    
      $('#alice').on('input', function() {
        $('#mirror').text($('#alice').val());
      });
    });
    
    
    
    
    

提交回复
热议问题