Learn HTML by Building a Cat Photo App - Step 14

I am having trouble properly adding a target attribute to the anchor element’s opening tag. Please assist.

<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <h2>Cat Photos</h2>
      <!-- TODO: Add link to cat photos -->
      <p>Click here to view more <a href="https://freecatphotoapp.com">cat photos</a>.</p><a href="https://freecatphotoapp.com">target"_blank"</a>
      <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
    </main>
  </body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15

Challenge: Learn HTML by Building a Cat Photo App - Step 14

Link to the challenge:

You seem to have added a second anchor element. You don’t want to do that. The only thing the instructions are asking you to do is add the target attribute with a value of _blank. You have already added a src attribute to the img element. And you have already added the href attribute to the anchor element. Adding a target attribute follows the same pattern.

Thank you for your response, I am unsure of where to add the target attribute, every code I enter is incorrect.

An opening tag can have more than one attribute. Just add the new one after the existing one. Or before the existing one. Order does not matter when it comes to attributes.

How do I incorporate the attribute, I don’t know where to place it. May I please have an example? Thank you.

check here

Please can someone help me with this! I have tried following the attribute tutorial and I am still entering the wrong code! I cannot move forward and I and becoming quite frustrated!

You will need to show us what you have tried by pasting your HTML in here. To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key. You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.

This is the code that I have just attempted.
<p>Click here to view more <a href="https://freecatphotoapp.com"target"_blank">cat photos</a>.</p>

You didn’t follow my instructions above for pasting your HTML in here so we can see it.

I don’t even know what back ticks are.

Then you can use one of the two alternative methods I described:

“You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.”

I’ve edited your code 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 (').

you added the word target but you forgot the equal sign on its right

Posting pics of code is generally frowned upon here. In this case we can tell what the problem is because this is a simple issue. But you should not get in the habit of doing it. Use one of the methods I explained above to paste your actual code in here from now on.


Everything I try is incorrect. :weary:

As @hbar1st said earlier:

“you forgot the equal sign”

Look at how you added the href value to this link. Do you see an equal sign separating the attribute name and its value? You need to do the same thing for the target attribute.

I am not sure what I am doing incorrectly. Please assist, and thanks everyone in advance for your assistance thus far.

target is the name of the attribute
“_blank” is the -value- of the attribute

Therefore, you need to put the equal sign between the word target and its value

just like you did for href and its value