Change jQuery text field field value, binding function

Is there a way to bind a change event for a text field in jQuery? I.E. whenever the value changes, is the function called? I am currently using keyup, but this does not apply to every case, i.e. Right click and paste.

Thank.

+5
source share
3 answers
$("#element").bind("keyup input paste", function() {
    //Do Work Here
});
+10
source

Have you tried to use the change () trigger?

$('.target').change(function() {
  alert('Handler for .change() called.');
});

http://api.jquery.com/change/

+2
source

keyup, , , , Firefox. ? ? ?

http://jsfiddle.net/9fJwC/

+2

All Articles