How can I implement a select-style drop down menu in HTML with an option that is a text input?
The idea being that someone can either select from a list of predefined options, or input their own option.
This question is related to
javascript
jquery
html
You can use input text with "list" attribute, which refers to the datalist of values.
<input type="text" name="city" list="cityname">_x000D_
<datalist id="cityname">_x000D_
<option value="Boston">_x000D_
<option value="Cambridge">_x000D_
</datalist>
_x000D_
This creates a free text input field that also has a drop-down to select predefined choices. Attribution for example and more information: https://www.w3.org/wiki/HTML/Elements/datalist
Source: Stackoverflow.com