If you know the Index, Value or Text. also if you don't have an ID for a direct reference.
This, this and this are all helpful answers.
Example markup
<div class="selDiv">
<select class="opts">
<option selected value="DEFAULT">Default</option>
<option value="SEL1">Selection 1</option>
<option value="SEL2">Selection 2</option>
</select>
</div>
For setting select value with triggering selected:
For setting option from a scope:
This code use selector to find out the select object with condition, then change the selected attribute by
attr()
.Futher, I recommend to add
change()
event after setting attribute toselected
, by doing this the code will close to changing select by user.