Dude I don’t know if it’s gonna suit you exactly, but sometimes <datalist>
attend to you.
Link about the tag: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist
The difference between a <select>
and a <datalist>
is that in the select
vc determines the options that the user is "obliged" to choose between them. Already the datalist
vc offers some suggestions to the user, but he is free to type whatever you want, ie it is a list predefined, not a list predetermined as the select
.
The <datalist>
element represents the list that represent Predefined
options for other Controls.
Translating: The element <datalist>
represents the list representing predefined options for other controls.
Official source W3C: https://www.w3.org/wiki/Html/Elements/datalist
Tip: Although not the focus of this question here is another question that was asked here at Stackoverflow and that has more information about these two tags: What is the </datalist tag for>?
Take 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>
Learn more about datalist https://answall.com/questions/197571/pra-que-serve-a-tag-datalist/197573#197573
– user60252
@Leocaracciolo already includes the link in the reply! Well complete the material there!
– hugocsl
@Leocaracciolo Thanks! I really didn’t think so, because I was researching in the wrong way. I’m glad you and Hugo helped me. Hugs
– MSHijo