<datalist>:HTML 数据列表元素
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
尝试一下
属性
该元素除了公用的全局属性之外,没有其他属性。
示例
html
<label
>Choose a browser from this list: <input list="browsers" name="myBrowser"
/></label>
<datalist id="browsers">
<option value="Chrome"></option>
<option value="Firefox"></option>
<option value="Internet Explorer"></option>
<option value="Opera"></option>
<option value="Safari"></option>
</datalist>
结果
规范
Specification |
---|
HTML # the-datalist-element |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
datalist |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.