Html forms contain following elements.
The <form> element
<Form> element defines a form that is used to collect user input.
The <Input> element.
<Input> elements are very important for forms <input> elements are of different types like text fields, checkboxes, radio buttons, submit buttons, etc. input element is tag and attribute is define to different type of input method like text input or selection input.
Syntax: <input type=”value”>
- Checkbox: Defines a checkbox
- Color: Defines a color picker
- Date: Defines a date control (year, month and day (no time))
- datetime-local: Defines a date and time control (year, month, day, hour, minute, second, and fraction of a second (no time zone)
- email: Defines a field for an e-mail address
- file: Defines a file-select field and a “Browse…” button (for file uploads)
- hidden: Defines a hidden input field
- image: Defines an image as the submit button
- month: Defines a month and year control (no time zone)
- number: Defines a field for entering a number
- password: Defines a password field (characters are masked)
- radio: Defines a radio button
- range: Defines a control for entering a number whose exact value is not important (like a slider control)
- reset: Defines a reset button (resets all form values to default values)
- search: Defines a text field for entering a search string
- submit: Defines a submit button
- tel: Defines a field for entering a telephone number
- text: Defines a single-line text field (default width is 20 characters)
- time: Defines a control for entering a time (no time zone)
- url: Defines a field for entering a URL
- week: Defines a week and year control (no time zone)
Note: some attribute values are not run in your browser because some browser is not supporting.