There may be a better solution, but this is what came to mind:
var value = $("#yourInput").val();
$("#yourInput").on('keyup change click', function () {
if(this.value !== value) {
value = this.value;
//Do stuff
}
});
Here's a working example.
It simply binds an event handler to the keyup
, change
and click
events. It checks whether or not the value has changed, and if so, stores the current value so it can check again next time. The check is required to deal with the click
event.