I have a select field with some options in it. Now I need to select one of those options with jQuery. But how can I do that when I only know the
select
options
Use the change() event after selecting the value. From the docs:
change()
If the field loses focus without the contents having changed, the event is not triggered. To trigger the event manually, apply .change() without arguments:
.change()
$("#select_id").val("val2").change();
More information is at .change().