We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

引进于 HTML5

概述

HTML Datalist 元素 (<datalist>) 包含了一组<option>元素,这些元素表示其它表单控件可选值.

属性

该元素除了公用的全局属性之外,没有其他属性。

示例

<label>Choose a browser from this list:
<input list="browsers" name="myBrowser" /></label>
<datalist id="browsers">
  <option value="Chrome">
  <option value="Firefox">
  <option value="Internet Explorer">
  <option value="Opera">
  <option value="Safari">
</datalist>
 
 
 
 
 
 
 
 
 

结果

规范

规范 状态 备注
HTML Living Standard
<datalist>
Living Standard  
HTML5
<datalist>
Recommendation  

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 20 4.0 (2.0) 10 9.5 未实现
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 33 4.0 (2.0) 未实现 10 未实现

Polyfill

datalist-polyfill

另请参阅

文档标签和贡献者

此页面的贡献者: mfranzke, Jianming, SphinxKnight, koaqiu, JulieLee77, ziyunfei
最后编辑者: mfranzke,