" and " Home >
Article > Web Front-end > What are the tags used to implement drop-down lists in html5 html5 implements drop-down list tags such as " The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer. In HTML5, if you want to implement a drop-down list, you need to use Among them, the Example: It can be seen that the drop-down list will display the first item first by default, so what if a certain item is pre-selected? You can use the After setting the selected attribute for the Recommended tutorial: "html video tutorial" The above is the detailed content of What are the tags used to implement drop-down lists in html5. For more information, please follow other related articles on the PHP Chinese website!What are the tags used to implement drop-down lists in html5
<select></select>
and <option></option>
together. Syntax: <select>
<option>列表选项值</option>
.....
</select>
<select></select>
tag is used to create a drop-down list, and the <option></option>
tag represents each item (entry) in the drop-down list. <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
喜欢的水果:
<select>
<option>请选择选项</option>
<option>苹果</option>
<option>梨子</option>
<option>桃子</option>
<option>香蕉</option>
<option>李子</option>
<option>菠萝</option>
<option>榴莲</option>
</select>
</body>
</html>
selected
attribute of the selected="selected"
of the 喜欢的水果:
<select>
<option>请选择选项</option>
<option>苹果</option>
<option>梨子</option>
<option>桃子</option>
<option selected="selected">香蕉</option>
<option>李子</option>
<option>菠萝</option>
<option>榴莲</option>
</select>