HTML Attributes

HTML list attribute

Build a form with the HTML form generator

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

NameTypeDescription
listdatalist IDAssociates 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>
HTML Reference