Introduction to the functions and usage of value and name attributes in Html

Introduction to the functions and usage of value and name attributes in Html
1. The value used in the button refers to the text to be displayed on the button, such as "OK", "Delete", etc.

2. The value used for the checkbox refers to the value of the checkbox

3. The value used for radio buttons is the same as that for check boxes

4. The value used in the drop-down menu is the value of each item in the list

5. The value used for the hidden field is the content displayed in the box


In the background, if you want to get the content of the checkbox, it is value. When you get data on the page that receives form data, you get the value of value.

1. name is the name of the control (multiple controls can have the same name), and value is the value of the control;
2. Not all controls’ values ​​are displayed, such as checkbox, radio, hidden.
3. Define the name and value of the control to get the control and its value on the server;
4. If you don't see the name of submit, it doesn't mean that the browser ignores its name. Before submission, the browser also defines a name, and its name and value can still be obtained on the server;
5. A control can be displayed without defining a name/value. Its name/value is defined only to facilitate reception and distinction on the server. Of course, the value of a button is not only used to store its value, but also for display.
[code]
<html>
<select>
<option value="1">Flowers</option>
<option value="2" selected="selected">Gardens</option>
<option value="3">Trees</option>
</select>
<form>
<input type="checkbox" name="newsletter" checked="checked" value="Daily" />vjn
<input type="checkbox" name="newsletter" value="Weekly" />bvc
<input type="checkbox" name="newsletter" checked="checked" value="Monthly" />cvb
</form>
<input type="button" value="OK"/>
<SPAN style="WHITE-SPACE: pre">&nbsp;<input type="text" value="Please enter content"/> </SPAN>
</html>

<<:  Summary of Form Design Techniques in Web Design

>>:  Running PostgreSQL in Docker and recommending several connection tools

Recommend

My CSS framework - base.css (reset browser default style)

Copy code The code is as follows: @charset "...

XHTML tutorial, a brief introduction to the basics of XHTML

<br />This article will briefly introduce yo...

How to connect idea to docker to achieve one-click deployment

1. Modify the docker configuration file and open ...

Basic tutorial on controlling Turtlebot3 mobile robot with ROS

Chinese Tutorial https://www.ncnynl.com/category/...

A comprehensive summary of frequently used statements in MySQL (must read)

The knowledge points summarized below are all fre...

Detailed tutorial on installing MySQL database in Linux environment

1. Install the database 1) yum -y install mysql-s...

What does this.parentNode.parentNode (parent node of parent node) mean?

The parent node of the parent node, for example, t...

Several situations where div is covered by iframe and their solutions

Similar structures: Copy code The code is as foll...

Example code of how to implement pivot table in MySQL/MariaDB

The previous article introduced several methods f...

Summary of data interaction between Docker container and host

Preface When using Docker in a production environ...

9 ways to show and hide CSS elements

In web page production, displaying and hiding ele...

Web Design: Web Music Implementation Techniques

<br />When inserting music into a web page, ...

How to deploy zabbix_agent in docker

zabbix_agent deployment: Recommendation: zabbix_a...