Add Placeholder Text to a Text Field 2

Add Placeholder Text to a Text Field 2
0

#1

Tell us what’s happening:
Can’t pass the tests. Here’s the code in question:

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>
  <input type="cat photo URL">
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6.

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


#2

The instructions asked you to set the placeholder attribute’s value of the input element to “cat photo URL”. Instead, you set the type attribute’s value to “cat photo URL”.


#3

Sorry, but I’m not seeing any difference between what I’ve typed:
and whatever you are asking me to type: “cat photo URL”

Please feel free to correct me if I’m wrong though.


#4

Both type and placeholder are valid attributes for an input element. The instructions ask you to set the placeholder attribute’s value to “cat photo URL”.

The original input looked like the following;

<input type="text">

You changed the type attribute’s original value from “text” to “cat photo URL” and did not add a placeholder attribute and set it to “cat photo URL”. If the instructions would have asked you to set the type value of the text input to “cat photo URL”, you would have passed the challenge, but it did not, so you did not pass.

My point is, you should never have modified the original value of the type attribute. Instead, you just needed to add a placeholder attribute and assign it the value “cat photo URL”.


#5

Thank you. Just did that and it worked. I think I’m over complicating most of the challenge instructions.