Adding required attribute

Your text input element should have the required attribute.:

<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"required>

    <button type="submit">Submit</button>

  </form>

</main>
  **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"required>
  <button type="submit">Submit</button>
</form>
</main>
  **mozilla firefox:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0

Challenge: Use HTML5 to Require a Field

Link to the challenge:

1 Like

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

What seems to be the issue or confusion? Both of these seem to pass the challenge.

The required is just used to say that field must be filled before the form can be submitted.

thanks, i didn’t knew. Absolute beginner )

yes, i believe this too, but he gives this issue :

Your text input element should have the required attribute.

And so, he doesn’t allow, why : i don’t know …

And you’re certain this is your exact code?

Do you have any browser extensions turned on that could be interfering? Ad blockers, dark mode, etcetera?

yes, i just copied what i have filled in.
I have a yoroi wallet and a metamask wallet, but for the rest noting special.
Maybe i should try it on another browser ?
But mozilla should be reliaible …

Those don’t sound like they should effect anything, but it wouldn’t hurt to try another browser just in case.

I’m not super familiar with the platform yet, so maybe someone with more experience could lend a hand.

ok, i will try another browser, but first i go to bed here…
Thanks :slight_smile:

1 Like

WTF ? I tried on google chrome, and overthere , it worked without problem.
So it’s definitely a problem from Firefox …

Fixed :slight_smile:

1 Like

It sounds like either you have a setting or extension in Firefox that prevented the tests from working or perhaps that your browser cache had gotten into a weird state. All challenges should work in Firefox (and your solution did pass in Firefox when I ran it).

I know that this sort of thing can be frustrated, so good job keeping at it. Happy coding!

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