Forms
The <label> element can be used to attach information (like a text label) to form controls.
Attributes for <label>
Type | Attribute List |
'Standard' Attributes | "for" |
New HTML5 Attributes | "form" and "writingsuggestions" |
Notes
- Each <label> element should be associated with only one form control.
- The "placeholder" attribute should not be used as an alternative to a <label> element.
Recommended Links
Accessibility Information & Tips
- For required form controls, indicate the required status in the control's <label> or <legend>. If not indicated by text (like "(required)"), then make sure the meaning of the indicator is explained before it is used. NOTE: Abbreviating "required" to "req." may be confusing. Visit https://www.w3.org/TR/WCAG20-TECHS/H90 for more information.
- In <select> elements, use <optgroup> to group related <option> elements. Label the option groups with the "label" attribute. Avoid using dummy list entries to delimit groups. Visit https://www.w3.org/TR/WCAG20-TECHS/H85 for more information.
Search Engine Links (for more information)