<datalist> - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:datalist

Introduction

The list attribute sets the id value of a datalist element.

You can use it to suggest options to the user when they enter data into the text box.

The datalist Element summary

Item Value
Element: datalist
Local Attributes:None
Contents:option elements and phrasing content
Tag Style: Start and end
New in HTML5?Yes
Changes in HTML5:N/A
Style Convention:None

The datalist element defines a set of values that assist the user.

Different types of input elements use the datalist element in slightly different ways.

For the text type, the values are presented as autocomplete suggestions.

You specify the values through the option element, which is described in the following table.

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body></body>
</html><!-- w  ww.  jav  a 2 s . c om-->

Related Tutorials