Applied Accessibility -6 Improve Form Field Accessibility with the label Element
Improve Form Field Accessibility with the label Element
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>
source
Comments
Post a Comment