This wiki has been archived and is now read-only.


From HTML Wiki
Jump to: navigation, search


The <datalist> element represents the list that represent predefined options for other controls.


  • The value of a option element in a datalist elment represent a suggestion.

  • The datalist element is hooked up to an input element using the list attribute on the input element. [Example A]

HTML Attributes

See global attributes.


Example A

[try it]:

<input type="text" name="city" list="cityname">
<datalist id="cityname">
  <option value="Boston">
  <option value="Cambridge">

HTML Reference

The HTML5 specification defines the <datalist> element in 4.10.10 The datalist element.