English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The list attribute refers to a <datalist> element that contains predefined options for the <input> element, and the list attribute is an HTML5of the new attribute in.
An <input> element with predefined values in a <datalist>:
<!DOCTYPE html> <html> <head> <title>HTML:<input> list 属性 - 基础教程网(oldtoolbag.com)</title> <body> <form action="action_page.php" method="get"> <input list="languages" name="language"> <datalist id="languages"> <option value="Golang"> <option value="C#"> <option value="C++"> <option value="PHP"> <option value="Java"> </datalist> <input type="submit"> </form> </body> </html>Test to see ‹/›
IEFirefoxOperaChromeSafari
Internet Explorer 10, Firefox, Opera, and Chrome support the list attribute.
Note:Safari or Internet Explorer 9 and earlier versions do not support the list attribute of the <input> tag.
list attribute reference <datalist> element that contains predefined options for the <input> element.
The list attribute is an HTML5 of the new attribute in.
<input list="datalist_id">
Value | Description |
---|---|
datalist_id | Specifies the id of the datalist associated with the <input> element. |