Definition and Usage. The tag is used to provide an "autocomplete" feature for elements. : Permitted ARIA roles The HTML is pretty simple. Permitted parents: Any element that accepts phrasing content. The HTML datalist element contains a set of option elements that represent the permissible or recommended options available to choose from within other controls. 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:
You can access a element by using getElementById(): Include this polyfill to provide support for older and currently incompatible browsers:Get the latest and greatest from MDN delivered straight to your inbox.The newsletter is offered in English only at the moment. Citing from MDN “Styling HTML forms – the ugly”: Some elements simply can't be styled using CSS. Choose your browser from the list:
Internet Explorer, Firefox, Chrome and Edge apply basic styling to the input[list] element, but neither to datalist, nor to its option child elements. Content categories: Flow content, phrasing content. The Datalist object represents an HTML element.
Datalist Object. Examples might be simplified to improve reading and basic understanding. The element's id attribute must be equal to the element's list attribute (this binds them together). The source for this interactive example is stored in a GitHub repository. Access a Datalist Object. L'Element HTML Datalist () conté un conjunt d'elements que representen els valors disponibles per a altres controls. The tag specifies a list of pre-defined options for an element.. ... Get the latest and greatest from MDN delivered straight to your inbox. Note: The element is not supported in Internet Explorer 9 (and earlier versions), or Safari. Users will see a drop-down list of pre-defined options as they input data. If you'd like to contribute to the data, please check out While using this site, you agree to have read and accepted our If you'd like to contribute to the interactive examples project, please clone The compatibility table in this page is generated from structured data. A select box can have a different submit value vs. display label Internet Explorer . : Tag omission: None, both the starting and ending tag are mandatory. A fed text box has a single string for both display label and submit. If you haven’t already created an account, you will be prompted to do so after signing in. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. html.Datalist is a dash_html_components component. Sign in to enjoy the benefits of an MDN account. If you aren't familiar with it, it basically provides a "autosuggest" style experience to an input tag. Here is the example used in the MDN article I linked to above:
Get it now → Type: block Self-closing: No Permalink Share Can I use MDN # datalist Defines a list of autocomplete options when using a text . The datalist tag is one of my favorite HTML tags and something I've blogged about a few times in the past. A fed text box does not support the tag to organize the display. The newsletter is offered in English only at the moment. Styling datalist with CSS only is not possible across browsers. See CodePen example. Official examples and reference documentation for html.Datalist.
W3Schools is optimized for learning, testing, and training. : Permitted content: Either phrasing content or zero or more elements.