jQuery Input Event does not Fire if Input is Empty

前端 未结 1 1815
天涯浪人
天涯浪人 2021-01-13 05:42

I have a jQuery event handler that reacts to every change in an

 

element:

$(\"#m         


        
相关标签:
1条回答
  • 2021-01-13 05:49

    as far as I know, "input" is not the event you want to use. Since "input" is analogous to "change", it tends to produce a bad result when your string approaches 0 chars, use keyup instead

    $("input#myId").bind('keyup', function (e) {    
        // Do Stuff
    });
    
    0 讨论(0)
提交回复
热议问题