Suggestions and Option Groups
Use datalist for suggestions and optgroup for categories inside an enforced choice.
Datalist suggests without restricting
Optgroup organizes a fixed set of options
Choose by behavior
- A datalist keeps the input editable; its options are suggestions.
- A select limits submission to one of its available options.
- An optgroup label helps users scan a long select without becoming selectable itself.