Asp.net mvc 如何使用jQuery获取aspnet mvc DropDownList项
我试图从DropdownList中获取这样的文本:Asp.net mvc 如何使用jQuery获取aspnet mvc DropDownList项,asp.net-mvc,Asp.net Mvc,我试图从DropdownList中获取这样的文本: $('#test option:selected').text() 但不起作用 <div class="col-md-10"> @Html.DropDownList("Percentage", new SelectList(items, new { @class = "form-control", @id = "test" })) </div> 但是仍然没有。你需要修复你的下拉列表。现在,您的下拉属性与
$('#test option:selected').text()
但不起作用
<div class="col-md-10">
@Html.DropDownList("Percentage", new SelectList(items, new { @class = "form-control", @id = "test" }))
</div>
但是仍然没有。你需要修复你的下拉列表。现在,您的下拉属性与选择列表混合在一起
<div class="col-md-10">
@Html.DropDownList("Percentage", new SelectList(items), new { @class = "form-control", @id = "test" })
</div>
有没有发生什么错误?
<div class="col-md-10">
@Html.DropDownList("Percentage", new SelectList(items), new { @class = "form-control", @id = "test" })
</div>