Accessible forms
Exercise30 min
Accessible forms
Forms are where accessibility pays off most. Three rules:
- 1.Every input has a label bound with
for/id— clicking the label
focuses the input, and screen readers announce it.
- 1.Never remove focus outlines; style them instead.
- 2.Describe errors in text, not color alone.
<label for="email">Email</label>
<input id="email" type="email" required />
<p class="error" role="alert">Email is required.</p>Keyboard-only users navigate with Tab. Try it on your own form: if you cannot reach and complete the form with the keyboard alone, it is broken for them.
Exercise
Build a signup form with labeled email + password fields, and show an inline text error (with role="alert") when submitted empty.
Practice in the diagram lab
This lesson's practice belongs in the diagram editor — design the schema you just read about, grade it against the solution, and save it to your account.
Open the diagram lab