Sometimes you would like to suggest some options to a user as they type something into an input. Maybe there are popular search categories or tags that people are looking for. You could, of course, implement an API driven feature or if you want to get a quick way for it to be up and running why not just use the datalist tag?

The HTML datalist element contains a set of option elements that represent the permissible or recommended options available to choose from within other controls. - MDN

Datalist acts as a hybrid between a normal input and a select field where it allows users to either choose a suggested option, see suggestions as you type or add in your own option.
So how does it work?

Let’s show you how to add the datalist tag to a regular old text input as a simple example (and probably the most common one you will use).
datalist will work nearly identically to a select tag taking inner options.I’ll also show you an example of using the tag with other inputs too!

#html5 #html #web-development #programming #developer

Easy Autocomplete/Suggestions for Inputs With Just HTML5 | Datalist Tag HTML
3.60 GEEK