HomeReferencesHTML Tags

HTML Tag: label

Label for a form element (input, textarea or select).

HTML Dog, The Book HTML Dog book cover

HTML Dog is hosted by Titan Internet

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" />