I do not know if it will suit you exactly, but sometimes <datalist>
caters to you.
Link to the tag: link
The difference between a <select>
and a <datalist>
is that in select
you determine the options that the user is "required" to choose between them. While datalist
vc offers some suggestions for the user, but it is free to type what you want, that is, it is a pre-defined list , not a pre- / em> as the select
.
The <datalist>
element represents the list that represents predefined
options for other controls.
Translating: The <datalist>
element represents the list that represents default options for other controls.
Official source W3C: link
Tip: Although not the focus of this question here is another question that was made here in Stackoverflow and has more information about these two tags: What is the < / datalist >? tag
See the example of datalist
working.
<input list="browsers" />
<datalist id="browsers">
<option value="Chrome">
<option value="Firefox">
<option value="Internet Explorer">
<option value="Opera">
<option value="Safari">
</datalist>