gpt4 book ai didi

jquery - 带有 Bootstrap 的 mvc 下拉列表

转载 作者:行者123 更新时间:2023-11-28 05:59:20 25 4
gpt4 key购买 nike

我想要可搜索的下拉列表 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com