HTML forms and input

巴扎黑
Release: 2017-04-15 09:06:48
Original
1669 people have browsed it

HTML form

A form is an area containing form elements.

Form elements allow users to enter content in the form, such as text areas, drop-down lists, radio-buttons, checkboxes, etc.

Forms are set up using the form tag

:



.
input elements
.


HTML Form - Input Element

The most commonly used form tag is the input tag ().

Input types are defined by the type attribute (type). Most commonly used input types are as follows:


Text Fields

The text field is set through the tag. When the user types letters, numbers, etc. in the form, the text field is used.



First name:

Last name:


Password field

The password field is defined with the tag :



Password:


Radio Buttons

tag defines the form radio button options



Male

Female

The browser display effect is as follows:


Checkboxes

defines a checkbox. The user needs to select one or several options from a number of given choices.



I have a bike

I have a car

The browser display effect is as follows:


Submit Button

defines the submit button.

When the user clicks the confirm button, the form's contents are 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. :



Username:




HTML form tag

New : HTML5 new tag

Label describe
Define a form for user input
Define input fields