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
  • 57,247
  • 24
  • 95
  • 149
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,304
  • 10
  • 63
  • 113