javascript get dropdown on selected one option code example
Example 1: get selected text of html dropdown in javascript
var e = document.getElementById("selectElementID");
var value=e.options[e.selectedIndex].value;
var text=e.options[e.selectedIndex].text;
Example 2: javascript get selected option
let selectElement = document.getElementById("selectElement");
let valueSelected = selectElement.options[selectElement.selectedIndex].value;
var text= selectElement.options[selectElement.selectedIndex].text;