About Label
suggest changeThe <label> element is used to label a form control.
In the scope of User Interface it’s used to ease the target / selection of elements like Type radio or checkbox.
<label> as wrapper
It can enclose the desired action element
<label>
<input type="checkbox" name="Cats">
I like Cats!
</label>
(Clicking the text toggles the target input.)
<label> as reference
Using the for attribute, you don’t have to place the control inside the label, but the for value must match the control’s id.
<input id="cats" type="checkbox" name="Cats">
<label for="cats" >I like Cats!</label>
Note
Don’t use more than one Control Element within a <label> element
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents