Help with HTML code

Tell us what’s happening:
Describe your issue in detail here.

Hi, Ihave to nest an input element inside a form element, but when I run the test it says:" The existing input element should be nested within a form element." I can’t see where the mistake is in my code. Please help!!!

  **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://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" 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="https://www.freecatphotoapp.com/submit-cat-photo">
  <input type="text" placeholder="Cat photo URL">
</form>

</main>
  **Your browser information:**

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

Challenge: Create a Form Element

Link to the challenge:

i copy your code and paste in that challenge its says error but when i type myself i pass the test , so write your code again

1 Like

Hi @JorgeBolumar,
your code is right, I copied and pasted your code and got your error, but after formatting it like this I passed the test.

<h2>CatPhotoApp</h2>
<main>
  <p>Click here to view more <a href="#">cat photos</a>.</p>
  
  <a href="#"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" 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="https://www.freecatphotoapp.com/submit-cat-photo">
    <input type="text" placeholder="cat photo URL">
  </form>
</main>

This is your code formatted.

If you’re still having trouble try disabling exstensions like Dark Mode, AdBlock and set your browser zoom to 100%.

I hope I was helpful. :wave:

1 Like

I think your issue is with the capital C in
cat of cat photo url inside input placeholder.
Your input should be lower case like:
<input type = "text" placeholder = "cat photo URL" >
and not:
<input type = "text" placeholder = "Cat photo URL" >
Hope it helps

Thanks to everyone who replied. Apparently the problem was the capital C inside placeholder, I don’t understand why anyway. Thanks @tom3 !!!

1 Like

@JorgeBolumar Maybe it is because the test code is comparing the input tag and its code as is. So when the text inside changes, its identifying it as a change to the input element. The next time when freeCodeCamp provides pre written code, try not to change it in anyway.
Happy Coding :sparkles:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.