Home > Web Front-end > HTML Tutorial > What does the datalist tag mean?

What does the datalist tag mean?

云罗郡主
Release: 2019-01-30 13:24:24
Original
5973 people have browsed it

What does the

datalist tag mean?

What does the datalist tag mean?

The datalist tag defines the option list and specifies the possible option list for the input element. The datalist tag is used in conjunction with the input element to define the possible values ​​of the input. The datalist and The options are not displayed, just a list of valid input values. [Recommended tutorial: HTMLTutorial]

Function: Define the option list and specify the possible option list for the input element.

Note: Please use this element in conjunction with the input element to define the possible values ​​of the input. The datalist and its options are not displayed, it is just a list of valid input values. Please use the list attribute of the input element to bind the datalist.

Note: The tag is supported by all major browsers except Internet Explorer and Safari. The tag is new in HTML 5.

Example:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input list = "name">
<datalist id = "name">
    <option value = "猪哥">
    <option value = "无忌哥哥">
    <option value = "peter_朱">
    <option value = "灭绝师太">
    <option value = "西门大官人">
</datalist>
</body>
</html>
Copy after login


The above is the detailed content of What does the datalist tag mean?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template