list attribute | list property
Specifies the ID of a pre-defined datalist of options for an input element.
This property is read-only.
![]() ![]() |
Syntax
| HTML |
|---|
<element list="ID" ... > |
| JavaScript |
|---|
ID = object.list |
Property values
Type: HTMLElement
The ID of a datalist element that contains options for input.
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.10.7.3.3
Remarks
The following example creates a datalist called "quantity".
<form > Choose quantity : <input type="number" list="quantity" /> <datalist id="quantity"> <option label="A dozen" value="12" /> <option label="A gross" value="144" /> <option label="A thousand" value="1000" /> </datalist> <input type="submit" /> </form>
See also
Show:

