-
Notifications
You must be signed in to change notification settings - Fork 22.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into standards-position-banner-guidelines
- Loading branch information
Showing
24 changed files
with
2,690 additions
and
1,105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: "HTMLAnchorElement: text property" | ||
short-title: text | ||
slug: Web/API/HTMLAnchorElement/text | ||
page-type: web-api-instance-property | ||
browser-compat: api.HTMLAnchorElement.text | ||
--- | ||
|
||
{{ApiRef("HTML DOM")}} | ||
|
||
The **`text`** property of the {{domxref("HTMLAnchorElement")}} represents the text inside the the element. | ||
This property represents the same information as {{domxref("Node.textContent")}}. | ||
|
||
## Value | ||
|
||
A string. | ||
|
||
## Example | ||
|
||
```html | ||
<a id="exampleLink" href="https://example.com">Example Link</a> | ||
<p class="text"></p> | ||
``` | ||
|
||
```css | ||
#exampleLink { | ||
font-size: 1.5rem; | ||
} | ||
``` | ||
|
||
```js | ||
const anchorElement = document.getElementById("exampleLink"); | ||
const pTag = document.querySelector(".text"); | ||
pTag.textContent = `Text property: ${anchorElement.text}`; | ||
``` | ||
|
||
### Result | ||
|
||
{{EmbedLiveSample("Example",100,100)}} | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- {{domxref("HTMLScriptElement.text")}} property | ||
- {{domxref("HTMLOptionElement.text")}} property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.