How to add labels to form elements

There are two ways to associate a label with a form element such as a checkbox. Either of the methods causes the label text to also become a click target for the checkbox, which is also helpful for mouse or touchscreen users. To associate a label with an element, either:

Place the input element inside of a label element

<label>
  <input type="checkbox">Receive promotional offers?</input>
</label>

Or use the label's for attribute and refer to the element's id

<input id="promo" type="checkbox"></input>
<label for="promo">Receive promotional offers?</label>