--- id: bad87fee1348bd9aedc08830 title: Use HTML5 to Require a Field challengeType: 0 videoUrl: 'https://scrimba.com/p/pVMPUv/cMd4EcQ' --- ## Description
You can require specific form fields so that your user will not be able to submit your form until he or she has filled them out. For example, if you wanted to make a text input field required, you can just add the attribute required within your input element, like this: <input type="text" required>
## Instructions
Make your text input a required field, so that your user can't submit the form without completing this field. Then try to submit the form without inputting any text. See how your HTML5 form notifies you that the field is required?
## Tests
```yml tests: - text: Your text input element should have the required attribute. testString: assert($("input").prop("required"), 'Your text input element should have the required attribute.'); ```
## Challenge Seed
```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
```
## Solution
```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
```