HTML Form

The <form> element defines an HTML form

HTML forms are used to collect user input.

HTML forms contain form elements.
Form elements are different types of input elements, checkboxes, radio buttons, submit buttons, and more.

S.No. Element Element
1 Input Defines an input control
2 Textarea Defines a multiline input control (text area)
3 Select Defines a drop-down list
4 Option Defines an option in a drop-down list
5 Fieldset Groups related elements in a form
6 Legend Defines a caption for a fieldset element

Types Input type

S.No. Element Description Example
1 Text Default. Defines a single-line text field
2 Password Defines a password field
3 Radio Button Defines a Radio Button
4 Check Box Defines a check Box
5 Date Defines a date formated Text Box
6 Button Defines a button without any event
7 Submit Defines a submit button
8 Reset Defines a reset button
Example
Your Name :-
Password :-
Gender :- Male Female
Hobbies :- Playing Reading
Date :-
<form>
Your Name  	:- 	<input type='text'><br>
Password	:- 	<input type='password'><br>
Gender  	:- 	<input type='radio' name='gender'>Male <input type='radio' name='gender'>Female<br>
Hobbies   	:- 	<input type='checkbox' name='hobbies'>Playing <input type='checkbox' name='hobbies'>Reading<br>
Date	   	:- 	<input type='date' name='date'><br>
	<input type='button' value='Button'><input type='Submit'><input type='Reset'>
</form>