Challenge 1: Fix a Placeholder-Only Field — Possible Solution
====================================================================
Full name
WHY THIS WORKS
--------------
- A real element is added, matched to the input via the
for="full-name"/id="full-name" pair — this is the load-bearing
association the chapter describes: it makes the label clickable (a
bigger target that focuses the input) and guarantees a screen reader
announces "Full name" when the field receives focus.
- The placeholder is KEPT, but its role changes entirely: it's no
longer being asked to do the label's job (identifying WHAT the field
is for). Instead it now shows a genuinely helpful example format
("e.g. Jane Smith") — exactly the appropriate use of a placeholder,
supplementary guidance rather than the field's only identification.
- This fixes all three problems the chapter lists for placeholder-only
fields: the field's purpose ("Full name") no longer disappears once
typing starts, since it's now permanently visible as the label; the
label text uses normal, full-contrast text rather than placeholder's
typically lower-contrast styling; and the label is now reliably
announced by every screen reader, rather than depending on
inconsistent placeholder-announcement behavior.
- This is a strictly additive fix — nothing about the input's type,
id, or existing placeholder needed to be removed; a real label was
simply added alongside what was already there, addressing the gap
without discarding the example-text guidance the placeholder still
usefully provides.