Input attribute value

Input generally uses the
name attribute with label to specify the name of the input element, as well as to identify the form data submitted to the server, and to reference the form data on the client side through JS.
Insert picture description here

TEXT
text is the most commonly used attribute value. This defines a single line of text. The default width is 20 characters. If you need to write multiple lines of text, use textarea.
Insert picture description here

PASSWORD
password defines a password and is a mask.
Insert picture description here
The display is like this, it is the state that we usually enter the password.
Insert picture description here
BUTTON
button The button can be clicked. If there is a word on the button, you can write the value value in the input tag.

<input type="button" value="button">

submit Submit button, the submit button will send the form content to the server.
reset The reset button will clear all the content in the form.

<input type="submit" value="提交">
<input type="reset" value="重置">

The effect is such a
Insert picture description here
radio button, write the same value in the name, so that you can determine which are the same group, and the server can make effective judgments after submission.

<label>单选</label>
<input type="radio" name="1">
<input type="radio" name="1">

Checkbox checkbox, you can select multiple options. checked="checked" is the default option.

    <label>复选框</label>
    <input type="checkbox" name="1" checked="checked">
    <input type="checkbox" name="1">
    <input type="checkbox" name="1">

Insert picture description here
PS: It is the first time to write, if there is any mistake, please correct me.

Guess you like

Origin blog.csdn.net/weixin_44401120/article/details/90296466