HTML <datalist> Tag

Description

The <datalist> HTML element creates a list of options that can be selected when typing in a text field. Initially, this list is hidden and becomes available when the field receives focus or when typing.

Properties

Permitted Parents
Any element that accepts phrasing content
Content
<option> elements
Start/End Tags
Start tag: required, End tag: required

Example

Enter an Australian State:<br>
<input list="browsers">
<datalist id="browsers">
<option value="South Australia">
<option value="Western Australia">
<option value="Victoria">
<option value="New South Wales">
<option value="Queensland">
<option value="Tasmania">
</datalist>

Attributes

None

Global Attributes

The <datalist> tag also supports the Global Attributes in HTML5

Event Attributes

The <datalist> tag also supports the Event Attributes in HTML5

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
10Yes2049.512.1
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
X334X12.2Yes