[usefulangle] Setting Value of Select Element (2018/06/26) [2019/07/26]
<select id="choose-fruit>
<option value="1">Apple</option>
<option value="2">Orange</option>
<option value="3">Banana</option>
</select>
// Set option with value 'Orange' as selected
document.querySelector('#choose-fruit').value = 'Orange';
/ Set the option with index 2 as selected => Sets the 'Banana' option as selected
document.querySelector('#choose-fruit').selectedIndex = 2;