HTML Attributes
HTML list attribute
Associates a supported input with a datalist of suggestions. It does not restrict the input to the listed values; use select when a closed set is required. Applicable elements include: <input>. Check each element’s value rules.
Formal Syntax & Structure
html syntaxhtml
list="cities"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| list | datalist ID | Associates a supported input with a datalist of suggestions. It does not restrict the input to the listed values; use select when a closed set is required. |
Working Example
Example Snippethtml
<label> City <input list="cities" name="city"></label><datalist id="cities"> <option value="Stockholm"> <option value="Oslo"> </datalist>