The HTML <datalist> element contains a set of <option> elements that represent the values available for other controls.

Content categories Flow content, phrasing content.
Permitted content Either phrasing content or zero or more <option> elements.
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts phrasing content.
Permitted ARIA roles None
DOM interface HTMLDataListElement

Attributes

This element has no other attributes than the global attributes, common to all elements.

Examples

<label for="myBrowser">Choose a browser from this list:</label>
<input list="browsers" id="myBrowser" name="myBrowser" />
<datalist id="browsers">
  <option value="Chrome">
  <option value="Firefox">
  <option value="Internet Explorer">
  <option value="Opera">
  <option value="Safari">
  <option value="Microsoft Edge">
</datalist>

Result

Specifications

Specification Status Comment
HTML Living Standard
The definition of '<datalist>' in that specification.
Living Standard  
HTML5
The definition of '<datalist>' in that specification.
Recommendation  

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 20Edge Full support YesFirefox Full support 4IE Full support 10Opera Full support 9.5Safari No support NoWebView Android No support NoChrome Android Full support 33Edge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS No support NoSamsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

Polyfill

Include this polyfill to provide support for older and currently incompatible browsers:
datalist-polyfill

See also