The appendData() method of the CharacterData interface adds the provided data to the end of the node's current data.
appendData(data)dataThe data to append to the current node.
None.
<span>Result: </span>A textconst span = document.querySelector("span");
const textNode = span.nextSibling;
textNode.appendData(" - appended text.");