document.getElementById('pickerArea').innerHTML = `
<select id="selectTheme">
<option>default</option>
<option>ayu-dark</option>
<option>ayu-mirage</option>
</select>`;
var sel = document.getElementById('selectTheme');
if(sel) {
sel.addEventListener('onchange', (event) => {
alert('Theme changed');
});
}
<select id="selectTheme" onchange="alert('Theme changed')">
</select>
sel.addEventListener('change', (event) => {
alert('Theme changed');
})