What is wrong my code?

Tell us what’s happening:

Your code so far

 <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>
   <li>cat nip</li>
   <li>laser pointers</li>
 <p>Top 3 things cats hate:</p>
   <li>flea treatment</li>
   <li>other cats</li>
 <form action="/submit-cat-photo">
  <input type="text" placeholder="cat photo URL">

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36.

Challenge: Create a Form Element

Link to the challenge:

Do you see the error message below the editor box? That is telling you exactly what the problem is. I don’t think there is anything I can add that the error message won’t tell you. As a programmer you should get used to using error messages to help you fix problems because you’ll be relying on them a lot as things get more complicated :slight_smile:

While I agree that this is an important skill, it is a skill that some of us are still learning.

The description instructs:

Nest your text field inside a form element, and add the action="https://freecatphotoapp.com/submit-cat-photo" attribute to the form element.

This is what you have:

 <form action="/submit-cat-photo">
  <input type="text" placeholder="cat photo URL">

So you have nested the input, but the action attribute is not correctly set.

As bbsmooth points out, if you look in the lower left, there is a readout of the test that failed:

Your form should have an action attribute which is set to https://freecatphotoapp.com/submit-cat-photo

When I fix that one problem, your code passes.

1 Like