Required Field Doesn't Work

Required Field Doesn't Work
0

#1

Tell us what’s happening:
“Your text input element should have the required attribute.” No matter how I write this code, I still am getting this message. It seems to be nested.

Your code so far


<h2>CatPhotoApp</h2>
<main>
  <p>Click here to view more <a href="#">cat photos</a>.</p>
  
  <a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
  
  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <input type="text" placeholder="cat photo URL">
    <button type="submit">Submit</button>
    <input type="text"  required/>
  </form>
</main>

Your browser information:
Google Chrome Version 68.0.3440.106 (Official Build) (64-bit)
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5/use-html5-to-require-a-field


#2

Why did you add a new input element? The instructions say to make your text input a required field, so try just modifying the existing input element with which the challenge starts?


#3

Thanks! I misread the instructions. I thought I had to make an entirely new element.


#4

You really have to watch some of these html/css challenges regarding what is expected. If they want you to add a new element, it will be fairly explicit.