I'd like to simulate a change event in my input, but I'm not getting it to work.
As the page loads, I select a different value in my input like this:
$("#selExercicio option:contains('" + ano + "')").prop("selected", true);
It's working.
Next I try to trigger:
$("#selExercicio").trigger("change");
My input change event is this:
$("#selExercicio").change(function () {
debugger;
alert('Mudou');
});
And it's not calling the alert when loading the page, only when I change the input value by clicking with the mouse.
Does anyone have a clue why it's not working?