How to get the selected value of MS Drop-down list

2019-03-07 03:57发布

问题:

I have used MS Dropdown list in my MVC Project. Now I want to get the MS Dropdownvalue using Jquery. How can achieve that?

$("#Country").msDropdown();

I want to get the selected value of INDIA using JQuery.

var countryName = $("#Country option:selected").val();

It does not seem to be working.

回答1:

Use

var countryName = $("#Country option:selected").text();

instead of

var countryName = $("#Country option:selected").val();