The <label> element

An <label> element associates a text label with a form <input> field and is implemented using the DOM HTMLLabelElement interface. The label can tell users what value should be entered in the input field. Having labels helps the accessibility of a form. You can implicitly or explicitly associate a label with a form. When doing it explicitly, you use the for attribute, and implicitly, you nest the <input> directly inside the <label>.

<label>: The Label element

The <label> HTML element represents a caption for an item in a user interface.


Source: Mozilla, https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label
Creative Commons License This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.