A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/HTMLAnchorElement/text below:

text · WebPlatform Docs

text Summary

Legacy. Use anchorElement.textContent instead. Functions identically to Node.textContent.

Property of dom/HTMLAnchorElementdom/HTMLAnchorElement

Syntax
var anchorText = anchorElement.text;
anchorElement.text = newAnchorText;
Return Value

Returns an object of type StringString

The text content of the element.

Examples

The 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
WHATWG HTML
Living Standard
HTML5
W3C Last Call Working Draft

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