feat(curriculum): add interactive examples to target attribute lesson (#62674)

This commit is contained in:
minjo70
2025-10-10 16:59:16 -06:00
committed by GitHub
parent fbcd965f15
commit 9932f6ea72

View File

@@ -5,14 +5,20 @@ challengeType: 19
dashedName: what-are-the-different-target-attribute-types
---
# --description--
# --interactive--
You may have seen the `target` attribute on anchor elements, or links. This important attribute tells the browser where to open the URL for the anchor element:
You may have seen the `target` attribute on anchor elements, or links. This important attribute tells the browser where to open the URL for the anchor element.
Click on the link and you will be directed to the freeCodeCamp homepage in a new browser tab.
:::interactive_editor
```html
<a href="https://freecodecamp.org" target="_blank">Visit freeCodeCamp</a>
```
:::
There are four important possible values for this attribute. Note that each value is preceded by an underscore.
The first value is `_self`, which is the default value. This opens the link in the current browsing context. In most cases, this will be the current tab or window.