Home > Article > Web Front-end > The difference between name and value in input tag_HTML/Xhtml_Web page production
type control used for entry and exit in the browser (for example, type="text", this is a text box; type="button", this is a button)
The optional values of type are as follows:
button button
checkbox check button component
file file upload component
hidden hidden field
image picture area
password password input text box
radio radio button component
reset reset form Button
submit submit form button
text text input box
********************************** ***************************************
id is a unique identifier and is not allowed There are duplicate values (similar to the primary key of a data table, pk), and the corresponding html tag object can be obtained through its value. (If duplicate ids appear in the same page code, unpredictable errors will occur)
js code: document.getElementById("id_value")
Get its object reference based on the specified id
* *************************************************** **********************
The functions of name and id are the same. They are also used to identify html tags, but the only difference is that name allows repeated values. .
js code: document.forms[0].name or document.getElementsByName("name")
Get its object reference array based on the specified name
************* *************************************************** **********
value represents the value of an html tag
For example:
You will see that the content of the text box on the web page is "hello!"
/////////////////////////////////////////////////// ////////////////////////