Step 1: MVC Dropdown
@Html.DropDownList("Gender", new List<SelectListItem>
{
new SelectListItem { Text = "Male", Value = "Male"},
new SelectListItem { Text = "Female", Value = "Female"}
}, "Select Gender")
Step 2:
Get selected value from Dropdown
$("#Gender option:selected").val();
Step 3: Reset
Dropdown
$("#Gender").val('');
OR
$("#Gender").get(0).selectedIndex = 0;
No comments:
Post a Comment