HTML Attributes

HTML required attribute

Build a form with the HTML form generator

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

html syntaxhtml
required

Parameters & Attributes

NameTypeDescription
requiredbooleanMakes 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

Example Snippethtml
<label>  Email  <input type="email" required></label>

Browser Compatibility

Minimum supported versions across modern rendering engines

Blink (modern)
Chrome
4
Yes
EdgeHTML / Blink
Edge
12
Yes
Gecko
Firefox
4
Yes
WebKit
Safari
5
Yes
Presto / Blink
Opera
≤12.1
Yes
Desktop support for required on input only; other elements, input types, individual values and mobile behavior may differ.
HTML Living Standard
HTML Reference