How to get selected value of dropdownlist using JavaScript

To get selected value of dropdownlist using JavaScript you can use the following snippet.

Sample Javascript

var dropDown = document.getElementById("MyDropDownId");
var dropdownValue = e.options[e.selectedIndex].value; //get the value
var dropdownText = e.options[e.selectedIndex].text; //get the text

Please Share us:
Please rate this snippet

4 thoughts on “How to get selected value of dropdownlist using JavaScript

Leave a Reply