我想要可搜索的下拉列表 like this link .
我正在使用 ASP.NET MVC
<td class="input">
<select id="classLessonSelect">
@foreach (Student student in Model) {
<option value=@student.id>@student.Name @student.Surname</option>
}
</select>
</td>
我做不到,如何将其集成到我的代码中?
最佳答案
您是否考虑过使用像 Select2 https://select2.github.io/ 这样的插件? .它有很多选项,其中之一是可搜索的选择。设置很容易,例如
$("#selectId").select2();
关于jquery - 带有 Bootstrap 的 mvc 下拉列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36856841/