jQuery textbox change event doesn't fire until textbox loses focus?

后端 未结 7 1064
执念已碎
执念已碎 2020-12-04 06:06

I found that jQuery change event on a textbox doesn\'t fire until I click outside the textbox.

HTML:


         


        
7条回答
  •  再見小時候
    2020-12-04 06:56

    On modern browsers, you can use the input event:

    DEMO

    $("#textbox").on('input',function() {alert("Change detected!");});
    

提交回复
热议问题