An HTML form is a section of a document which contains controls such as "text fields", "password fields", "checkboxes", "radio buttons", "submit button", "menus" etc.
An HTML form facilitates the user to enter data that is to be sent to the server for processing such as "name", "email address", "password", "phone number" etc. .
HTML forms are required if we want to collect some data from of the site visitor.
For example: If a user want to purchase some items on internet, he/she must fill the form such as shipping address and credit/debit card details so that item can be sent to the given address.
<form action="backend-url" method="post"> <input type="text" value="John" onclick="handleusername()" /> <button type="button"> Submit </button> </form>
Let's see the list of HTML 5 form tags.
-> It defines an input control.
The HTML element is fundamental form element. It is used to create form fields, to take input from user. We can apply different input filed to gather different information form user. Following is the example to show the simple text input.
<form> <label> Enter your name </label> <input type="text" name="username" value="dummy value" placeholder="Enter user name"> </form>