Reputation: 206
My function uses jQuery to select an option from a select element:
$('#id>option:eq(13)').prop("selected",true);
However, this does not trigger the event that is supposed to happen when the user manually selects an option. Is there a way to trigger this event?
Upvotes: 1
Views: 1152
Reputation: 1195
yes there is a way. you can trigger events from jquery object.
$('#id>option:eq(13)').prop("selected",true).trigger('change');
Upvotes: 3