Form Summary
In this lesson, we learned how to use forms and discovered that:
- A form is created using the
form
element with the following attributes:action
, which specifies the URL where the form data will be sent.method
, which specifies the request method. Most commonlyPOST
.
- Inputs are created using the
input
element with the following attributes:name
- the name of the input.id
- the identifier of the input.type
- the type of the input.
- Some example input types include:
password
- for passwordsnumber
- for numeric inputcheckbox
- for checkboxesrange
- for selecting a value within a specific range
- The description of an input is created using the
label
element, which has afor
attribute with the same value as theid
attribute of the correspondinginput
element. - Form submission is performed using the
input
element with the attributetype="submit"
and thevalue
attribute, which specifies the text to be displayed on the button. - To make an input required, we add the
required
attribute to the input.
Instructions
Congratulations on completing the HTML course! The editor contains your final code from this lesson. Now you can customize the page using your newly acquired knowledge.
Start programming for free
9/9