label element
<Label>
Explanation
Label element is used to create label within a form.
The label acts as the "option".
<form>
<label>Text</label>
<input type="Value" name="Text" id="Text">
</form>
Element Specific attributes supported by this element are:
| Attribute | Value | Description |
| for | element_id | Mentions about the label related to from input. |
| form | form_id | Indicates the forms, to which the label belongs to. |
Example Code:
Result :
- Click and select the available options.
- It must be enclosed by the <form> and <Input>.
It is available in previous versions of HTML5.
It supports both
Global Attributes and
Event Attributes in HTML5.
Limitations:
It is applicable to all major browsers.