HTML required attribute
Makes supported form controls subject to a nonempty or selected-value constraint. Radio-group and checkbox behavior differs. It does not perform server-side validation. Applicable elements include: <input>, <select>, <textarea>. Check each element’s value rules. Boolean syntax: presence enables the state; omit the attribute to disable it. A string value of "false" does not turn it off. For a supported text field, an empty value fails the valueMissing constraint. In a radio group, one member being required means a selection is needed; required checkboxes must individually be checked. Disabled controls do not participate in constraint validation. The required attribute is not applicable to all input types.
Formal Syntax & Structure
requiredParameters & Attributes
| Name | Type | Description |
|---|---|---|
| required | boolean | Makes supported form controls subject to a nonempty or selected-value constraint. Radio-group and checkbox behavior differs. It does not perform server-side validation. |
Working Example
<label> Email <input type="email" required></label>Browser Compatibility
Minimum supported versions across modern rendering engines