jquery input change事件

2016年6月26日

input输入框的change事件,要在input失去焦点的时候才会触发

$(‘input[name=myInput]’).change(function() { … });
在输入框内容变化的时候不会触发change,当鼠标在其他地方点一下才会触发
用下面的方法会生效,input
$(“#input_id”).on(‘input’,function(e){
alert(‘Changed!’)
});

参考
http://stackoverflow.com/questions/1443292/how-to-implement-onchange-of-input-type-text-with-jquery

声明: 本文采用 BY-NC-SA 协议进行授权. 转载请注明转自: jquery input change事件
本文的评论功能被关闭了.