W3Schools is optimized for learning, testing, and training. The datalist tag is one of my favorite HTML tags and something I've blogged about a few times in the past. A datalist with pre-defined options (connected to an element):The numbers in the table specify the first browser version that fully supports the element.If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:

If you aren't familiar with it, it basically provides a "autosuggest" style experience to an input tag. While using this site, you agree to have read and accepted our

The HTML datalist element contains a set of option elements that represent the permissible or recommended options available to choose from within other controls. Datalist Object. A fed text box does not support the tag to organize the display. Styling datalist with CSS only is not possible across browsers. Citing from MDN “Styling HTML forms – the ugly”: Some elements simply can't be styled using CSS.

You can access a element by using getElementById(): Users will see a drop-down list of pre-defined options as they input data. The element's id attribute must be equal to the element's list attribute (this binds them together). Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. See CodePen example. A fed text box has a single string for both display label and submit. Sign in to enjoy the benefits of an MDN account. A select box can have a different submit value vs. display label . If you'd like to contribute to the interactive examples project, please clone The compatibility table in this page is generated from structured data.

Internet Explorer, Firefox, Chrome and Edge apply basic styling to the input[list] element, but neither to datalist, nor to its option child elements. L'Element HTML Datalist () conté un conjunt d'elements