如何获取DropDownListFor的选定项?这是我的下拉列表:
<div class="drop-down-list">
<%: Html.DropDownListFor(model => model.StageId, ViewBag.StagesList as SelectList,new { id="stageOne"})%>
<%: Html.ValidationMessageFor(model => model.StageId) %>
</div>
我尝试了这个但是没有用:
<script>
var e = $('#stageOne').val();
</script>
答案 0 :(得分:0)
从这里试试.. Get selected text from a drop-down list (select box) using jQuery
$("#yourdropdownid option:selected").text()
$("#yourdropdownid option:selected").val()