let selectedIndex = element.selectedIndex; if (selectedIndex > -1) { let selectedOption = element.querySelectorAll('option')[selectedIndex]; }