I am looking for a way to bind to an event whenever the text of a text box changes. Right now, I have something like this:
$("#inputPane").change(function() { alert("Changed!"); });
However, this only gets called when the text box loses focus. I want to get an event whenever a new character is added, deleted, or a cut/paste occurs.
I'd prefer not to use any third party plugins for this. Using pure jquery would be nicer.
The best option is to use keyup
event.
$("#inputPane").keyup(function() {
alert("Changed!");
});
However you should consider that it will fire whenever ANY key is clicked, even Ctrl, Alt, Shift, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With