Member-only story
HTML — Part-5
HTML Forms
12 min readMay 9, 2022
An HTML form is used to collect user input. The user input is most often sent to a server for processing. The HTML <form>
element is used to create an HTML form for user input:
<form>
.
form elements
.
</form>
The <form>
element is a container for different types of input elements, such as: text fields, checkboxes, radio buttons, submit buttons, etc.
HTML Form Attributes
- The Action Attribute
The action
attribute defines the action to be performed when the form is submitted. If the action
attribute is omitted, the action is set to the current page.
<form action="/action_page.php">
.
form elements
.
</form>
2. The Target Attribute
- specifies where to display the response that is received after submitting the form. Values that a target attribiute can have : -
<form action="/action_page.php" target="_blank">
3. The Method Attribute
- The
method
attribute specifies the HTTP method to be used when submitting the form dataget
orpost
.
<form action="/action_page.php" method="get">
4. The Autocomplete Attribute
- The
autocomplete
attribute…