required participates in a native control's constraint validation; aria-required communicates a requirement to accessibility APIs.
Make this comfortable
HTML required versus aria-required: semantics do not replace validation
Use it for a real task
A standard receipt field can use required directly. Adding aria-required to that same native field repeats information and is usually unnecessary. A custom widget might need ARIA state, but it must implement its own input, validation, error, and focus behavior.
<form action="/receipts/find" method="get">
<label for="lookup-code">Receipt code</label>
<input id="lookup-code" name="code" required>
<button type="submit">Find receipt</button>
</form>What the markup guarantees
The server still validates the code, even when the browser refuses an empty ordinary submission. ARIA changes accessibility semantics; it does not enforce a value or turn a custom div into a native input.
Cost and limits
Using the native attribute avoids a parallel validation implementation. A custom control raises testing cost across keyboard, touch, assistive technology, and browser validation states.
Common Mistakes
- Do not assume aria-required blocks form submission.
- Do not add redundant ARIA where the native attribute already supplies the state.
- Keep server validation independent of browser markup.
Connected lessons
- HTML constraint validation: improve feedback without trusting the browser
- HTML labels: bind each control to a durable accessible name
- HTML focus order: use native controls and keep DOM order usable
Related: HTML constraint validation: improve feedback without trusting the browser.
Related CSS decisions
html
comparison
