MCPcopy
hub / github.com/ampproject/worker-dom / textContent

Method textContent

src/worker-thread/dom/Element.ts:266–270  ·  view source on GitHub ↗

* @see https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent * @param text new text replacing all childNodes content.

(text: string)

Source from the content-addressed store, hash-verified

264 * @param text new text replacing all childNodes content.
265 */
266 set textContent(text: string) {
267 // TODO(KB): Investigate removing all children in a single .splice to childNodes.
268 this.childNodes.slice().forEach((child: Node) => child.remove());
269 this.appendChild(this.ownerDocument.createTextNode(text));
270 }
271
272 /**
273 * Getter returning the text representation of Element.childNodes.

Callers

nothing calls this directly

Calls 2

removeMethod · 0.80
createTextNodeMethod · 0.80

Tested by

no test coverage detected