Labels and Inputs

Give every field a clear name, purpose, and submission name.

Explicit labels connect visible text to controls

The label's for value matches the input's unique id. Selecting the label also focuses the input.

The placeholder gives an example; the visible label still names the field.

Why each attribute matters

Read the Phase 8 gauge

Important HTML

The label's for value must match the input's unique id so the visible name connects to the control.

<label for="full-name">Full name</label>
<input id="full-name" name="fullName" type="text" required>
<label for="email">Email address</label>
<input id="email" name="email" type="email" required>