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