list
all
alt
ch
dir
id
min
rel
top
url
URL
urn
TOC
Collapse the table of content
Expand the table of content

list attribute | list property

Specifies the ID of a pre-defined datalist of options for an input element.

This property is read-only.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.10.7.3.3

 

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

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

HTMLInputElement

 

 

Show:
© 2016 Microsoft