Home  >  Article  >  Web Front-end  >  datalist tag

datalist tag

PHP中文网
PHP中文网Original
2017-03-27 16:56:532512browse

datalst can be used together with the new attribute list of input to create a combo box. When double-clicking the input, options can be provided for the user to choose, similar to history records.

<input list="browsers">
 <datalist id="browsers">
    <option value="Safari">
    <option value="Internet Explorer">
    <option value="Opera">
    <option value="Firefox">
</datalist>

Definition and Usage

fc86e7b705049fc9d4fccc89a2e80ee3 Tag definition option list. Use this element in conjunction with an input element to define the possible values ​​of the input.

The datalist and its options will not be displayed, it is just a list of legal input values.

Please use the list attribute of the input element to bind the datalist.

Related articles:

HTML5 Daily Practice: The use of automatic completion of datalist tags

Examples of using html5 datalist tags (automatic Complete components)

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn