<label> element associates a label with a form control in an HTML form. The label can be associated with an
To make the association the label's for attribute must match the id attribute of the related element:
<input type="text" name="email" id="email" />
The name attribute is needed by the form to allow successful submission of the name/value pairs of form controls,
whereas the label attribute applies to the name given to the form field as it is shown on the screen.
<label> elements help with form accessibility as the label can be given an accesskey attribute which when
entered gives focus to its' associated form field.
- CORE AND LANGUAGE ATTRIBUTES - class, id, title, style, dir, lang
- MOUSE AND KEYBOARD EVENT ATTRIBUTES - onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmouseout, onmousemove, onkeydown, onkeyup, onkeypress
- accesskey - sets a single keyboard character as an accesskey for the element.
- for - associates the label with another element by matching the id of the associated element.
- onfocus - details an event to occur when the element receives focus.
- onblur - sets an event to occur when the element loses focus.