Only one option is selected at a time. You can try to run the following code to display the index of the selected option − When the Button is clicked, the GetSelectedTextValue JavaScript function is executed. How to get selected value from the dropdown using jQuery code. In ADVANCED Here I will explain how to get dropdownlist selected value in asp.net mvc razor with example or asp.net mvc get selected value from dropdownlist in razor with example or asp.net mvc bind dropdownlist values from database and get dropdownlist selected value with example. If you have the example below: Now an alert is displayed whenever an option is selected from the drop-down. The renderer is used only when the combo box is uneditable. In this post, we will see how to get the selected values in a multi-select drop-down in plain JavaScript. servlet. Finally, output the current state value on the DOM inside your JSX. I am sharing two simple examples here in this post explaining how to populate a SELECT dropdown list with JSON data using JavaScript. September 16, 2016 How to recover in JavaScript, the value of an option in a dropdown list? Paul Clapham wrote:From what I can see, at least from the original post, Thomas already has JSP code which generates the SELECT element.All that's needed is to improve that to add the "selected" attribute on the appropriate OPTION element. Then only you can populate the list from your DB. 3. selectedOptions property. The idea is to get an array of the all