# Target attribute

**URL:** <https://forum.freecodecamp.org/t/target-attribute/581515>\
**Category:** Curriculum Help\
**Tags:** html, css\
**Created:** [December 30, 2022, 6:30am UTC](https://forum.freecodecamp.org/t/target-attribute/581515 "2022-12-30T06:30:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krash](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Krash](https://forum.freecodecamp.org/u/Krash)\
**Post date:** [December 30, 2022, 6:30am UTC](https://forum.freecodecamp.org/t/target-attribute/581515/1 "2022-12-30T06:30:21Z")

</div>

how do i add a target attribute? please find below my code

```auto
<p>Click here to view more <a href="https://freecatphotoapp.com" "_blank">cat photos</a>.</p>

```

---

<div class="post-metadata">

**Author:** ![bbsmooth](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bbsmooth/32/203556_2.png) [@bbsmooth](https://forum.freecodecamp.org/u/bbsmooth)\
**Post date:** [December 30, 2022, 7:11am UTC](https://forum.freecodecamp.org/t/target-attribute/581515/2 "2022-12-30T07:11:30Z")

</div>

You add it just like you add any other attribute, such as the `href` attribute, using the format:

`name="value"`

Where you replace `name` with the name of the attribute (`target` in this case) and `value` with the value you want to set the attribute to.

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [December 30, 2022, 7:16am UTC](https://forum.freecodecamp.org/t/target-attribute/581515/3 "2022-12-30T07:16:05Z")

</div>

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.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (').

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [December 30, 2022, 7:17am UTC](https://forum.freecodecamp.org/t/target-attribute/581515/4 "2022-12-30T07:17:09Z")

</div>

HI @Krash !

Welcome to the forum!

In the future, it is best to use the Ask for help button in the challenge which will generate your code with the challenge link. 👍

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [June 30, 2023, 7:17pm UTC](https://forum.freecodecamp.org/t/target-attribute/581515/5 "2023-06-30T19:17:44Z")

</div>

Closed on June 30, 2023, 7:17pm UTC

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