<datalist>

Forms

Contains a set of option elements that represent predefined choices for an input element, providing autocomplete suggestions.

Common Attributes

id

Example

<input list="browsers" name="browser">
<datalist id="browsers">
  <option value="Chrome">
  <option value="Firefox">
</datalist>

About the <datalist> Element

The <datalist> HTML element belongs to the Forms category of HTML elements. Contains a set of option elements that represent predefined choices for an input element, providing autocomplete suggestions. Understanding when and how to use this element is essential for building well-structured, accessible, and SEO-friendly web pages.

The <datalist> element requires both an opening <datalist> and closing </datalist> tag. Content placed between these tags becomes the element's children. This element is part of the current HTML Living Standard and is supported in all modern browsers including Chrome, Firefox, Safari, and Edge.

Proper use of semantic HTML elements like <datalist> improves document structure, helps screen readers interpret content correctly, and provides signals to search engines about the purpose of different sections of your page. This leads to better accessibility scores, improved SEO rankings, and more maintainable code.

Related Elements