The remove() method of the CharacterData removes it from its parent node. If it has no parent node, calling remove() does nothing.
remove()None.
None (undefined).
remove()<span>Result: </span>A long string.const span = document.querySelector("span");
const textNode = span.nextSibling;
textNode.remove(); // Removes the text