var selectElement = document.getElementById("selectElementId");
var selectedValue = selectElement.options[selectElement.selectedIndex].value;
This should be changed to:
var selectElement = document.getElementById("selectElementId");
var selectedValue = selectElement.options[selectElement.selectedIndex].text;
Changing .valueto .textsolves the problem and is compatible with all browsers.
source
share