The HTML <label> tag is used for adding a label to a form control. It can be used on input, textarea or select.

Required Attributes

  • None.

Optional Attributes

  • for can be used to associate the label to a form element when the value of for matches the value of an element's id attribute.
  • accesskey can be used to associate a keyboard shortcut to the element.
  • Common attributes

Example

<label for="email">Email address</label><input type="text" name="email" id="email" />

Changes in HTML5

  • None.

Related Tags