HTML DOM Datalist Object

Datalist Object

The Datalist Object is new in HTML5.

The Datalist object represents an HTML <datalist> element.

Note: The <datalist> element is not supported in Internet Explorer 9 (and earlier versions), or Safari.

Access a Datalist Object

You can access a <datalist> element by using getElementById():

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

Create a Datalist Object

You can create a <datalist> element by using the document.createElement() method:

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

Datalist Object Collections

Collection Description
options Returns a collection of all the options in a datalist