HTML / Element / Initial coverage

<datalist> Element

Status: Initial coverage Scope: HTML Living Standard Specification checked: 2026-09-15

Technical Summary

The datalist element represents predefined options for another control, usually an input. The datalist is not normally rendered as page content; its options are used as input suggestions.

The input's list attribute connects to the datalist element's id. Suggestions do not impose a fixed value set, so fixed-choice requirements, validation, and the presentation of the suggestion UI must be evaluated separately.

Definition / Categories

ItemDefinition
MeaningA set of predefined option elements for another control
CategoriesFlow content; phrasing content
ContextWhere phrasing content is expected
Content modelPhrasing content, or zero or more option and script-supporting elements
Tag omissionNeither the start tag nor the end tag may be omitted
DOM interfaceHTMLDataListElement; its read-only options attribute returns an HTMLCollection

Association with input

A datalist becomes the suggestions source for an input when the input's list attribute references the datalist's ID. The input remains the control that holds and submits the value; the datalist is not a separate form control.

<label for="browser">Browser</label>
<input id="browser" name="browser" list="browser-options">

<datalist id="browser-options">
  <option value="Chrome"></option>
  <option value="Firefox"></option>
  <option value="Safari"></option>
</datalist>

This is an HTML ID reference. It does not mean that the datalist must be a child of the input, and it does not implicitly merge multiple suggestion sources.

The user agent draws this suggestion UI. Its opening behavior, filtering, labels, and keyboard interaction must not be treated as a fixed page-level UI contract.

Options that become suggestions

An option descendant of a datalist represents a suggestion when it is not disabled and its value is not the empty string. The suggestion has a value and a label; their presentation is part of the user agent's implementation.

ConditionMeaningReview point
Descendant of datalistIt belongs to that suggestions sourceRead it separately from a select option list
Not disabledIt can qualify as a suggestionDisabled excludes the option from suggestions; it does not disable all input
Non-empty valueIt has a suggestion valueDo not use an empty option as a separator or placeholder suggestion
label present or absentIt contributes label informationRendering varies by user agent, so essential information must not exist only in the label
<datalist id="countries">
  <option value="Japan" label="日本"></option>
  <option value="United States" label="アメリカ合衆国"></option>
  <option value=""></option> <!-- not a suggestion -->
  <option value="Legacy" disabled></option> <!-- not a suggestion -->
</datalist>

Form submission and constraint validation

Choosing a suggestion puts its value into the associated input. A datalist does not create the selectedness model of a select, and it does not reject a string merely because that string is not in the suggestions.

If the input needs constraints such as required, pattern, or minlength, put them on the input. Showing a suggestion does not itself make an outside value fail constraint validation.

<label for="ticket">Ticket number</label>
<input id="ticket" name="ticket" list="tickets"
       pattern="T-[0-9]{4}" required>
<datalist id="tickets">
  <option value="T-1024"></option>
  <option value="T-2048"></option>
</datalist>

Content model and fallback

The simple form places option elements directly inside datalist. The specification also defines fallback content for user agents that do not implement datalist. When fallback is used, verify the boundary between content shown to older user agents and options recognized as suggestions by current user agents.

<datalist id="animals">
  <label>Or choose from a list:
    <select name="animal">
      <option value="Cat">Cat</option>
      <option value="Dog">Dog</option>
    </select>
  </label>
</datalist>

The fallback select is its own form control. If this pattern is adopted, check its hidden boundary in current user agents, submission in older user agents, and duplicate labeling.

DOM Interface

HTMLDataListElement exposes a read-only options collection of its option elements. On the input side, input.list can be used to inspect the resolved datalist.

const input = document.querySelector('#browser');
const list = document.querySelector('#browser-options');

input.list === list;       // the associated datalist
list.options.length;       // number of options
list.options[0].value;     // first suggestion value
APISummary
HTMLDataListElement.optionsAn HTMLCollection rooted at the datalist and filtered to option elements
HTMLInputElement.listThe HTMLDataListElement resolved from list, or null
HTMLOptionElement.valueThe candidate value; an empty string does not meet the suggestion condition
HTMLOptionElement.disabledThe option's own disabled attribute; disabled options are excluded from suggestions

Fact / Evidence

Specification definitions, suggestion conditions, form boundaries, and DOM APIs are recorded as claims with scope and source locations. Browser suggestion UI and accessibility-tree observations are separated into Implementation Evidence below.

Primary facts and sources
TypeFact / claimCondition / scopeStatusSource
SPECdatalist represents a set of predefined option elements for another control.Element meaning, rendering, and usage context.ReviewedHTML Standard: the datalist element
SPECThe input's list attribute references the datalist's ID to connect the suggestions source.List attribute, ID reference, and input association.ReviewedHTML Standard: the list attribute
SPECA datalist option that is not disabled and has a non-empty value represents a suggestion.Descendant relationship, disabled state, and empty value.ReviewedHTML Standard: suggestion definition
SPECdatalist is not normally rendered as the list itself; it functions as a suggestions source.Normal user-agent rendering and fallback content.ReviewedHTML Standard: rendering and fallback
SPECHTMLDataListElement.options returns an HTMLCollection of the datalist's option elements.DOM interface and option collection.ReviewedHTML Standard: datalist options IDL

Evidence

  1. HTML Standard: The datalist element — categories, content model, suggestions, rendering, fallback, and DOM interface
  2. HTML Standard: The list attribute — association between an input and its suggestions source
  3. HTML Standard: The option element — option value, label, disabled state, and datalist context
  4. HTML Accessibility API Mappings — accessibility API boundary for inputs with a list attribute and a suggestions source
  5. Web Platform Tests: HTML forms — starting point for identifying tests for datalist, input, and option

Implementation Evidence

Browser implementation, WPT, and accessibility observations are recorded separately from specification claims. This page does not yet have a complete datalist-specific measurement, so partial observations and unexecuted work remain distinct.

Partial observation from an existing fixture: fixture ID forms-core-v1 contains input[list] and an option inside a datalist. The existing record confirms the datalist option's label, value, text, and form owner, plus the idle AX-tree exposure of an input with a datalist, in Chrome 152.0.0.0 / Windows 10 / 2026-09-15. Popup expansion, HTMLDataListElement.options, and input-type-specific suggestion UI remain unverified for this page.

datalist element implementation evidence registry
TypeObserved scopeConditions to recordStatus
IMPLinput[list], datalist option DOM values, HTMLDataListElement.options, suggestion popup, input value, and FormDataExisting forms-core-v1 covers the datalist option's label, value, text, and form owner. A datalist-specific fixture should check input.list, options, option updates, selected suggestion value, and FormData.Partial observation
WPTTests for the list attribute, suggestions, option conditions, datalist fallback, and DOM APIFrom the HTML forms test directory, ran datalistoptions.html and input-list-detached.html. On 2026-09-15 in Chrome 152.0.0.0 / Windows NT 10.0, the selected tests passed 3/3 on wpt.live. Remaining directory coverage and other browsers remain open.Partial (3/3 pass)
AAMRole and suggestions-source relationship for an input with list, plus exposed candidate options and statesThe existing record observes an input with datalist as a combo box in the idle AX tree in Chrome 152.0.0.0 / Windows 10 / 2026-09-15. Expanded listbox, option states, keyboard behavior, and assistive-technology differences remain unobserved.Partial observation

Suggestion popup presentation, label display, input-type support, and AX-tree exposure may depend on the user agent, OS, and interaction state. A single-environment partial observation is not registered as a cross-browser result.

Coverage / Open Issues

  • ReviewedMeaning, categories, context, content model, tag omission, and DOM interface
  • Reviewedlist-to-id association, disabled and empty-value suggestion conditions, and the input/datalist form boundary
  • ReviewedWhy suggestions are not fixed choices or validation rules, and the specification position of fallback content
  • OpenCross-browser popup opening, filtering, label display, keyboard behavior, and input-type differences
  • OpenDedicated fixture measurements for HTMLDataListElement.options, dynamic option updates, selected values, and FormData
  • OpenIndividual WPT results, expanded HTML-AAM state, assistive-technology observations, and fallback comparison in older user agents

This is initial coverage. It describes the specification scope; it does not claim identical suggestion UI, interaction, or accessibility API results across browsers, and it does not claim that outside values are automatically rejected.

Related surface

For beginner-friendly input suggestions, free-form input, and the list attribute, see Yugien's datalist element page. Input types and form validation are covered by Atlas on input; option values and labels by Atlas on option; and the fixed-choice model by Atlas on select.