What are valid values for the id attribute in HTML? That could also be why my suggestion of using SELECT instead might not be appropriate. No, the datalist element is for providing autocomplete to inputs. An example of each follows: Think of it as the difference between a requirement and a suggestion. If accepted
  • elements that you could manipulate however you want, it would have been really great! HTML5 Datalist is a new html tag shipped with HTML5 specification. Datalist is seem like type-ahead auto suggest textbox as you can see in Google search box. For certain elements, like, The spec says, "The start and end tags of certain normal elements can be omitted." This website uses cookies to ensure you get the best experience on our website. afaik (in 2019, on Chrome and Firefox), matches infixes (not just prefixes). In that case I think the answer is a bit more obvious. Datalist is like a "Select" dropdown list but user can freely input anything in the textbox other than what are listed in dropdown. If you're not going to bother giving the user options to choose from, why bother using a datalist? Also insofar as i can tell, the search is an exact match from the beginning of the string. For an input with type="text", this text will appear by default but be editable. select is widely supported by browsers compared to datalist. Can there be democracy in a society that cannot count? This code sample must be … Noun to describe a person who wants to please everybody, but sort of in an obsessed manner. Excellent answer!! For the datalistelement, it is suggested that the user select one of the options you've given, but he can actually enter anything he wants in the input. list vs. Tags have