HTML forms and input
HTML Forms and Input
HTML forms are used to collect different types of user input.
HTML Form
A form is an area that contains form elements.
Form elements allow users to enter content in the form, such as text areas, drop-down lists, radio-buttons, checkboxes, etc.
The form uses the form tag
HTML form-input element
Form tags used in most cases is the input tag ().
The input type is defined by the type attribute (type). The most commonly used input types are as follows:
Text Fields
Text fields are represented by the tag Setting, when the user wants to type letters, numbers, etc. in the form, the text field will be used.
Note: The form itself is not visible. Also, in most browsers, the default width of a text field is 20 characters.
The password field is defined by the tag :
Note: Password field characters will not be displayed in plain text, but will be replaced by asterisks or dots.
Radio Buttons
标签定义了表单单选框选项
Checkboxes
defines a checkbox. The user needs to select one or several options from a number of given choices.
Submit Button
defines the submit button.
When the user clicks the confirm button, the content of the form will be transferred to another file. The form's action attribute defines the file name of the destination file. The file defined by the action attribute usually performs related processing on the input data received. :
Put the above content together: