Home  >  Article  >  Web Front-end  >  What does a form in HTML consist of?

What does a form in HTML consist of?

青灯夜游
青灯夜游Original
2021-02-26 17:20:1414484browse

In HTML, a complete form usually consists of three parts: form elements (also called form controls), prompt information, and form fields. Form elements include specific form function items, such as single-line text input boxes, password input boxes, check boxes, submit buttons, reset buttons, etc.; the form field is equivalent to a container to accommodate all form elements and prompt information.

What does a form in HTML consist of?

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

1: What is a form

In a web page, we need to interact with users and collect user information. At this time, we need to use forms. . The purpose of using forms is to collect user information.

2: Form composition

In HTML, a complete form usually consists of form elements (also called form controls), prompts It consists of three parts: information and form fields.

1. Form elements

include specific form function items, such as single-line text input box, password input box, check box, submit button, reset button, etc.

2. Prompt information

A form usually also needs to contain some explanatory text to prompt users to fill in and operate.

3. Form field

The form field is equivalent to a container to accommodate all form elements and prompt information. It can be used to define the URL address of the program used to process form data, as well as data submission. method to the server.

If the form fields are not defined, the data in the form cannot be transmitted to the backend server.

[Recommended tutorial: "html video tutorial"]

Let me take the interface for registering NetEase mailbox as an example to talk about the three components of the above form

What does a form in HTML consist of?
The picture above is a form. The area where you fill in the password is the form element. "*Password"" is the prompt information. The entire valid area is called the form field.

三: What are the form tags

In HTML, there are 5 types of form tags, namely form, input, textarea, select, option

(Click on the name Link, jump to the details of each form label)

If the form is divided in terms of appearance, it can be divided into the following 8 types

  • Single-line text box
  • Multi-line text box
  • Password text box
  • Radio button
  • Check box
  • Button
  • File upload
  • Drop-down list

For more programming-related knowledge, please visit: Programming Video!!

The above is the detailed content of What does a form in HTML consist of?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn