I have the following event listener on my inputs on a HTML page:
$('input').on('input', function (e) {
console.log(this.value);
});
I understand the input event captures the following individual events change, keyup and paste.
When I update an input value using jQuery, I want to trigger this event so my event code runs. If I run:
//Does not work
$('input').val('test').trigger('change');
My event does not fire. I expected the input event handler to catch the change event. If I run:
//Does work
$('input').val('test').trigger('input');
This does work... why does triggering the change event not fire my input event handler?
oninputevent does not responds toonchangeevent. They are different. It would be really confusing world where one events trigger other events.