![]() |
VOOZH | about |
It is a Boolean attribute that is used to specify that the input element must be filled out before submitting the Form.
Elements: These attributes can be associated with three elements which are listed below:
Syntax:
<input required>Example-1: In this example, we demonstrate the use of the required attribute in a form. The attribute ensures that the "Username" field must be filled out before submitting the form.
Output:
👁 ImageSyntax:
<select required>Example-2: In this example we demonstrates the required attribute in a <select> field. It ensures users select an option other than "None" before submitting the form, styled with green italic headings.
Output:
👁 ImageSyntax:
<textarea required>Example-3: In this example we demonstrates the required attribute in a <textarea> field, ensuring users provide input before form submission. The page includes green, italic headings and a centered layout.
Output:
👁 ImageSupported Browsers: The browser supported by required attribute are listed below: