We’re all just temporarily abled.
Cindy Li
<label>
Username
<input type="text" />
</label>
<label for="username">Username</label>
<input id="username" type="text" />
<label for="username">Username</label>
<input id="username" type="text"
aria-describedby="username-hint" />
<p id="username-hint">Username must be
at least 8 characters long and cannot
contain special characters.</p>
type
Semantically identifies the type of content the input
accepts.
Occasionally suggests more specific labels for screen readers.
autocomplete
Tells browsers what user data to offer as autocomplete options.
Mapped to accessibility state.
inputmode
Suggests the ideal on-screen keyboard for mobile devices.
No accessibility mappings.
<input
type="text"
autocomplete="username"
autocapitalize="none"
autocorrect="off"
spellcheck="false"
/>
<input
type="email"
autocomplete="email"
/>
<input
type="tel"
autocomplete="tel"
/>
<input
type="text"
autocomplete=
"street-address"
/>
<input
type="number"
/>
“inappropriate for credit card numbers or US postal codes”
(HTML Spec)
<input
type="text"
inputmode="decimal"
/>
<input
type="text"
inputmode="decimal"
autocomplete="one-time-code"
/>
<input
type="date"
/>
<fieldset>
<legend>Start Date</legend>
<label for="month">Month (MM)</label>
<input id="month" type="text" inputmode="decimal" />
<label for="day">Day (DD)</label>
<input id="day" type="text" inputmode="decimal" />
<label for="year">Year (YYYY)</label>
<input id="year" type="text" inputmode="decimal" />
</fieldset>
By solving a11y issues at the
semantic level, we…
✓ improve UIs for existing technology
✓ future-proof them for years to come
jdsteinbach