W3Schools.com

HTML5 <input> list Attribute

HTML5 input Tag Reference HTML5 <input> tag

Example

An <input> element with pre-defined values in a <datalist>:

<input list="browsers" />

<datalist id="browsers">
  <option value="Internet Explorer">
  <option value="Firefox">
  <option value="Google Chrome">
  <option value="Opera">
  <option value="Safari">
</datalist>

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The list attribute is currently only supported in Firefox and Opera.


Definition and Usage

The list attribute refers to a <datalist> element that contains pre-defined options for an <input> element.


Differences Between HTML 4.01 and HTML5

The list attribute is new in HTML5.


Syntax

<input list="datalist_id" />

Attribute Values

Value Description
datalist_id Specifies the id of the datalist to bind the <input> element to


HTML5 input Tag Reference HTML5 <input> tag
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE