The text property of the HTMLAnchorElement represents the text inside the element. This property represents the same information as Node.textContent.
A string.
<a id="exampleLink" href="https://example.com">Example Link</a>
<p class="text"></p>#exampleLink {
font-size: 1.5rem;
}const anchorElement = document.getElementById("exampleLink");
const pTag = document.querySelector(".text");
pTag.textContent = `Text property: ${anchorElement.text}`;HTMLScriptElement.text propertyHTMLOptionElement.text property