jQuery change event not working in IE11

£可爱£侵袭症+ 提交于 2019-12-04 00:55:27

问题


I am using jQuery change event on a input text box. It seems to work properly in Chrome and Firefox but not in IE11. Is there any other event similar to change which is supported in IE.

jQuery 1.7.

<body>
   <input id="search"></input>
</body>

$('#search').on('change',function(){
   alert('hii');
})

jsfiddle:-- https://jsfiddle.net/7v0ohes8/


回答1:


I think you need to bind event on keyup that would work

$('#search').on('keyup',function(){
   alert('hii');
})

JsFiddle

Here is another reference of Same Answer



来源:https://stackoverflow.com/questions/30005576/jquery-change-event-not-working-in-ie11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!