MDN self-hosted library · e01.org

CharacterData: appendData() method

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

html
<span>Result: </span>A text
js
const span = document.querySelector("span");
const textNode = span.nextSibling;

textNode.appendData(" - appended text.");