0

How to get the selected item of DropDownListFor? This is my dropdownlistfor :

    <div class="drop-down-list">
        <%: Html.DropDownListFor(model => model.StageId, ViewBag.StagesList as SelectList,new { id="stageOne"})%>
        <%: Html.ValidationMessageFor(model => model.StageId) %>
    </div>

I tried this but it is not working :

<script>
    var e = $('#stageOne').val();
</script>
tereško
  • 58,060
  • 25
  • 98
  • 150
Angelina
  • 103
  • 4
  • 10

1 Answers1

0

Try this .. from here : Get selected text from a drop-down list (select box) using jQuery

$("#yourdropdownid option:selected").text()
$("#yourdropdownid option:selected").val()
Community
  • 1
  • 1
Mortalus
  • 10,574
  • 11
  • 67
  • 117