如何从mvc禁用下拉列表中选择文本

时间:2017-03-01 13:23:07

标签: javascript jquery asp.net-mvc

在我的mvc dropdwon中,我没有为禁用的下拉列表选择文本

@Html.DropDownList("ServiceID", ViewBag.Services as SelectList, "Select Service", new { @class ="form-control" ,name="ServiceID",disabled="disabled"})

我的jquery

var selectedText = $("#ServiceID option:selected").text();

0 个答案:

没有答案