Accessible form - example

Updated . Posted . Visible to the public.

The label tag wraps the text for a specific form control item, usually the name or label for a choice. This ties meaning to the item and makes the form more readable. The for attribute on a label tag explicitly associates that label with the form control and is used by screen readers.

The value of the for attribute must be the same as the value of the id attribute of the form control. Here's an example:

<form>
  <label for="name">Name:</label>
  <input type="text" id="name" name="name" />
</form>
Daniel
Last edit
Daniel
Keywords
accessibility
Posted by Daniel to Dev (2018-10-06 19:00)