HTMLAnchorElement: text ããããã£
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015å¹´7æ.
text 㯠HTMLAnchorElement ã®ããããã£ã§ãè¦ç´ å
ã®ããã¹ãã表ãã¾ãã
ãã®ããããã£ã¯ Node.textContent ã¨åãæ
å ±ã表ãã¾ãã
å¤
æååã§ãã
ä¾
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}`;
çµæ
仿§æ¸
| Specification |
|---|
| HTML > # dom-a-text > |
ãã©ã¦ã¶ã¼ã®äºææ§
é¢é£æ å ±
HTMLScriptElement.textããããã£HTMLOptionElement.textããããã£