Legacy. Use anchorElement.textContent instead. Functions identically to Node.textContent.
Property of dom/HTMLAnchorElementdom/HTMLAnchorElement
Syntaxvar anchorText = anchorElement.text;
anchorElement.text = newAnchorText;
Return Value
Returns an object of type StringString
The text content of the element.
ExamplesThe following script replaces every instance of the letter “a” in the text of an a element with instances of the letter "t", using the text property for getting and setting the text.
var anchor = document.getElementById("some-anchor");
anchor.text = anchor.text.replace(/a/g, "t");
Related specifications
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4