Home >Web Front-end >HTML Tutorial >How to set the value of select in html

How to set the value of select in html

青灯夜游
青灯夜游Original
2021-06-03 17:22:175240browse

In html, you need to use the option tag to set the value of select. The option tag defines an option in the drop-down list; the browser displays the content in the option tag as a menu of the select tag or an element in the scrolling list.

How to set the value of select in html

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer. The

select element creates a single-select or multiple-select menu.

The

option element defines an option (an entry) in a drop-down list.

The browser displays the content in the

The option element is located inside the select element.

Example: Set the value of select

<!DOCTYPE html>
<html>
<body>

<select>
  <option>Volvo</option>
  <option>Saab</option>
  <option>Mercedes</option>
  <option>Audi</option>
</select>
 
</body>
</html>

Rendering:

How to set the value of select in html

Recommended tutorial: " html video tutorial

The above is the detailed content of How to set the value of select in html. For more information, please follow other related articles on the PHP Chinese website!

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