Module label

Module label 

Source
Expand description

Attribute names for label (<label>) elements.

§Purpose

The <label> element represents a caption for a form control, improving accessibility and usability by associating descriptive text with inputs.

§Common Attributes

  • for: ID of the associated form control

§Example

<label for="email">Email Address:</label>
<input type="email" id="email" name="email">

<label>
  Username:
  <input type="text" name="username">
</label>

§WHATWG Specification

Constants§

FOR
The for attribute.