如何在HTML / Javascript中创建可编辑的组合框?
问题描述:
我需要让用户从下拉列表中选择一个项目,但也允许他们输入任何文本,即使它与列表中的项目不匹配。如何在具有HTML和Javascript的网页上实现此功能?
I need to let users select an item from a dropdown list, but also allow them to instead enter any text, even if it doesn't match an item in the list. How can I achieve this on a web page with HTML and Javascript?
选择
字段不允许用户输入文本,输入
文本字段未显示首选备选项。
The select
field doesn't let users enter text, and the input
text field doesn't show the preferred alternatives.