Home >Web Front-end >HTML Tutorial >Usage of form in html

Usage of form in html

下次还敢
下次还敢Original
2024-04-27 19:46:18891browse

HTML Form is an interface that allows users to enter and submit data on a web page. It contains: input fields (text, password, email, number, checkbox, radio button), selector (dropdown menu) and buttons (submit, reset). Forms are created using the <form> element, with name, action, and method attributes. After the user enters data and submits it, the form data is sent to the specified URL via an HTTP request.

Usage of form in html

Usage of HTML Form

What is HTML Form?

HTML Form, a web form, is an interface through which users can enter and submit data on a web page. It usually contains input fields, selectors, and buttons that allow users to interact with the website.

Create HTML Form

To create an HTML Form, you can use the <form> element:

<code class="html"><form>
  <!-- 输入字段、选择器和按钮 -->
</form></code>

Input field

The input field is used to collect data entered by the user. It has the following types:

  • <input type="text">: Single line text input
  • <input type="password">: Password protected single line text input
  • <input type=" email">: Email address input
  • <input type="number">: Number input
  • <input type ="checkbox">:checkbox
  • <input type="radio">:radio button

# #Selector

Selector allows the user to select a value from a list of options, including: