Attributes | Description |
for | Reference to the target ID Element. I.e: for=”surname” |
form | HTML5, [Obsolete] Reference to the form containing the Target Element. Label elements are expected within a Element. If the form=”someFormId” is provided this allows you to place the Label anywhere in the document. |
About Label
The element is used to reference a form action element. In the scope of User Interface it’s used to ease the target / selection of elements like Type radio or checkbox.
as wrapper
It can enclose the desired action element
(Clicking on the text the target input will toggle it’s state / value)
as reference
Using the for attribute you don’t have to place the control element as descendant of label – but the for value must
match it’s ID
Note
Don’t use more than one Control Element within a element
Basic Use
Simple form with labels…
Version ≥ 5