0

如何获取 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>
4

1 回答 1

0

试试这个 .. 从这里:使用 jQuery 从下拉列表(选择框)中获取选定的文本

$("#yourdropdownid option:selected").text()
$("#yourdropdownid option:selected").val()
于 2013-02-28T11:06:22.220 回答