gpt4 book ai didi

twitter-bootstrap - bootstrap - 带有自由文本的下拉菜单

转载 作者:行者123 更新时间:2023-12-04 07:42:50 24 4
gpt4 key购买 nike

我需要在 html 页面上显示一个下拉列表。如果用户没有找到他想要的值,我希望用户也可以在组合框中添加自由文本。有可能而且不太复杂吗?我有 Bootstrap 和 jquery。谢谢!

最佳答案

datalist这很容易——不需要 CSS/JavaScript。

这是一个 Bootstrap 示例:

<form role="form">
<div class="form-group">
<input type="text" class="form-control" list="select-list-id"/>
</div>
<datalist id="select-list-id">
<option value="What was your childhood nickname?"></option>
<option value="In what city did you meet your spouse/significant other?"></option>
</datalist>
</form>

fiddle .

关于twitter-bootstrap - bootstrap - 带有自由文本的下拉菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27375703/

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