mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-29 18:02:06 -05:00
feat(curriculum): add interactive examples to target attribute lesson (#62674)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user