The required attribute is a Boolean on supported <input>, <select>, and <textarea> controls. When present, the user must supply a value before the owning <form> can submit.
An empty required control suffers from valueMissing, matches :invalid / :required, and the browser shows a built-in message. Always show a visible cue (asterisk or text) near the label — do not rely on color alone.
Baseline · Widely available.
Not deprecated. Boolean: write required, not required="false". Presence means on.
Client-side only.
Users can bypass browser checks. Always validate again on the server. Skip required on readonly fields — it has no effect there.
Syntax
HTML Syntax
syntax.html
<input type="text" name="…" required>
<select name="…" required>…</select>
<textarea name="…" required>…</textarea>
In JavaScript: input.required = true. Optional controls match :optional.
Values
Attribute Values
Boolean — no value list. Common supported cases:
Control
What "filled" means
Try it
Text-like input / textarea
Non-empty value (after trimming rules of the type)
Radios: one in the group; checkboxes: only those with required.
Not enough alone — validate on the server; avoid with readonly.
One line:required makes a supported control mandatory before form submit.
Frequently Asked Questions
It is a Boolean attribute. When present on a supported control, the user must provide a value before the form can submit. An empty required field suffers from valueMissing and matches :invalid.
Most text-like inputs (text, search, url, tel, email, password, date types, number, checkbox, radio, file), plus select and textarea. Not on hidden, range, color, or button types.
No useful effect. Readonly fields do not participate in constraint validation. Do not pair required with readonly.
No. aria-required informs assistive tech. Only the HTML required attribute drives browser constraint validation. Prefer required on native controls; you may add aria-required as a belt-and-suspenders hint.
If any radio in a same-name group has required, one option in that group must be checked. Best practice: put required on every radio in the group, or on none.
No. It is a Baseline widely available HTML5 form attribute.