HTML Tutorial
HTML Forms
HTML Graphics
HTML Media
HTML API
HTML Forms
An HTML form collects the user input. The user input is often sent to a server for processing.
Example:
Output:
The <label> Element
The <label> element specifies a label for many form elements.
The <label> element is used by screen-reader users, because the screen-reader read out loud the label, while using the input element.
The <label> element also help users who face difficulty clicking on very small regions like the radio buttons or checkboxes.
The <select> Element
The <select> element specifies a drop-down list:
The elements provide an option that can be selected.
The first item in the drop-down list is selected by default.
Example
Output:
Visible Values:
Using the size attribute specifies the number of visible values:
Allow Multiple Selections:
Using the multiple attribute enables the user to select multiple value:
The <textarea> Element
The <textarea> element specifies a multi-line input field , that is a text area:
Example
Output:
The <button> Element
The <button> element is a clickable button:
Example
Output:
The <fieldset> and <legend> Elements
The <fieldset> element groups related data in a form.
The <legend> element captions the <fieldset> element.
Example
Output:
The <datalist> Element
The <datalist> element consists of a list of pre-defined options for an <input> element.
The list attribute of the <input> element,indicates to the id attribute of the <datalist> element.
Example
Output:
The <output> Element
The <output> element displays the result of a calculation,
Example
Output: