jQuery change事件在IE11中不起作用 [英] jQuery change event not working in IE11

查看:896
本文介绍了jQuery change事件在IE11中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在输入文本框上使用jQuery change事件.它似乎可以在Chrome和Firefox中正常运行,但不能在IE11中运行. IE是否支持其他任何与更改类似的事件.

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.

jQuery 1.7.

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

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

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

推荐答案

我认为您需要在keyup上绑定有效的事件

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

这篇关于jQuery change事件在IE11中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆