JSFiddle - React, Tailwind, and code Playground
HTML
<p>Focus me and then press 'b' on your keyboard. Expected result is that 'b' will be the selected option.</p>
<select id="empty_select" />
JavaScript
var el = document.getElementById("empty_select");
el.addEventListener("keydown", populateOptions, false);
function populateOptions() {
document.getElementById('empty_select').innerHTML = '<option>a</option><option >b</option>'
}