Required Input

Often, it is important for certain inputs to be filled out, for example, when logging in, the email or password needs to be filled out.

<input type="text" name="email" id="input-email" required/>

To set an input as required, simply add the required attribute. This attribute, similar to the controls attribute for videos, does not have a value. Just add it, and the input will be required to be filled out.

Instructions

Add the required attribute to the input with the name.

Add the required attribute to the input with the password.

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

8/9

Required Input | Start Coder