HTML DOM Datalist object

Datalist object

The Datalist object is new in HTML5.image.png

Datalist objects represent HTML <datalist> elements.

Access the Datalist object

You can use the getElementById() function to access <datalist> elements:

var x = document.getElementById("myDatalist");

 Try It! 

Create a Datalist object

You can use the document.createElement() method to create <datalist> elements:

var x = document.createElement("DATALIST");

 Try It! 

A collection of Datalist objects

optionsReturns a collection of all options in a datalist

Standard Properties and Events

Datalist objects also support standard properties and events .

Related pages

HTML Tutorial: HTML Forms

HTML Reference Manual: HTML <datalist> Tag