" or ""."/> " or "".">

Home  >  Article  >  Web Front-end  >  What does value mean in html

What does value mean in html

WBOY
WBOYOriginal
2021-12-17 16:52:2821445browse

The value in html means "value". The value attribute is used to set the value for the label element. The value attribute of different labels sets different values. The syntax is "".

What does value mean in html

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

What does value mean in html

The value attribute specifies the value of the element. The value attribute has different usage for different input types:

  • For "button", "reset", "submit" types - define the text on the button

  • For "text", "password", "hidden" types - Define the initial (default) value of the input field

  • For "checkbox", "radio", "image " type - Defines the value associated with the input element that is sent to the form's action URL when the form is submitted.

The value attribute is required for and . The value attribute does not apply to .

The syntax is:

<element value="value">
<element value="text">

The example is as follows:

<html>
<head> 
<meta charset="utf-8"> 
<title>123</title> 
</head>
<body>
<form action="demo_form.php">
  First name: <input type="text" name="fname" value="John"><br>
  Last name: <input type="text" name="lname" value="Doe"><br>
  <input type="submit" value="提交表单">
</form>
</body>
</html>

Output result:

What does value mean in html

Recommended tutorial: "html video tutorial

The above is the detailed content of What does value mean 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