1const options = Array.from(select.options);
2options.forEach((option, i) => {
3 if (option.value === use_id) select.selectedIndex = i;
4});
1document.getElementById('my-select').addEventListener('change', function() {
2 console.log('You selected: ', this.value);
3});