How to detect a textbox's content has changed

后端 未结 15 2070
猫巷女王i
猫巷女王i 2020-11-22 16:10

I want to detect whenever a textbox\'s content has changed. I can use the keyup method, but that will also detect keystrokes which do not generate letters, like the arrow ke

15条回答
  •  暖寄归人
    2020-11-22 16:28

    The 'change' event doesn't work correctly, but the 'input' is perfect.

    $('#your_textbox').bind('input', function() {
        /* This will be fired every time, when textbox's value changes. */
    } );
    

提交回复
热议问题