Good Code
The good version gives the email field a persistent accessible name by pairing the label and input with matching identifiers.
Lesson 06
Connect form controls to durable labels instead of relying on placeholder hints.
<form>
<!-- The label and help text stay connected to the input by id. -->
<label for="email">Email address</label>
<input id="email" name="email" type="email" autocomplete="email" aria-describedby="email-help" />
<p id="email-help">Use the address where you want review updates.</p>
</form><form>
<!-- Placeholder text is not a durable label for the field. -->
<input name="email" type="email" placeholder="Email address" />
<p>Use the address where you want review updates.</p>
</form>The good version gives the email field a persistent accessible name by pairing the label and input with matching identifiers.
The bad version depends on placeholder text, which disappears as soon as someone types and does not provide the same durable relationship as a label.