Question: how to get the dropdown selected value in html?
Answer: getElementById('ddlViewBy'). selectedOptions[0]. value; alert (getValue); // This will output the value selected. Beginners are likely to want to access values from a select with the NAME attribute rather than ID attribute.