An <input> element with pre-defined values in a <datalist>:
The <datalist> tag specifies a list of pre-defined options for an <input> element.
The <datalist> tag is used to provide an "autocomplete" feature on <input> elements. Users will see a drop-down list of pre-defined options as they input data.
Use the <input> element's list attribute to bind it together with a <datalist> element.
The numbers in the table specify the first browser version that fully supports the element.
Element | |||||
---|---|---|---|---|---|
<datalist> | 20.0 | 10.0 | 4.0 | Not supported | 9.0 |
The <datalist> tag is new in HTML5.
The <datalist> tag also supports the Global Attributes in HTML.
The <datalist> tag also supports the Event Attributes in HTML.
HTML DOM reference: Datalist Object
Most browsers will display the <datalist> element with the following default values: