How do i bind onchange event of a TextBox using JQuery?

后端 未结 7 988
我在风中等你
我在风中等你 2020-12-09 15:44

How can I bind an OnChange event of a TextBox to function using jQuery?

Am trying this and its failing:

$(document).ready(function() {
    $(\"input#         


        
7条回答
  •  庸人自扰
    2020-12-09 16:01

    What Chad says, except its better to use .keyup in this case because with .keydown and .keypress the value of the input is still the older value i.e. the newest key pressed would not be reflected if .val() is called.

    This should probably be a comment on Chad's answer but I dont have privileges to comment yet.

提交回复
热议问题