HTML <input> required Attribute (original) (raw)
Last Updated : 25 May, 2026
The required attribute is used to make an input field mandatory before submitting a form. It helps ensure that users fill in important fields.
- Prevents form submission if the input field is left empty.
- Commonly used with text fields, email inputs, checkboxes, and other form elements.
- It is a boolean attribute, so its presence alone makes the field required.
**Syntax:
**Example 1: Illustrates the use of required attribute in input Element.
html `
required Attribute