dropdown select js code example
Example 1: javascript to get value of dropdown
var e = document.getElementById("elementId");
var value = e.options[e.selectedIndex].value;
var text = e.options[e.selectedIndex].text;
Example 2: javascript select element in dropdown
document.getElementById("stateSelect").selected = true;