A RetroSearch Logo

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

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/CharacterData/remove below:

CharacterData: remove() method - Web APIs

MDN Web Docs
  1. Web
  2. Web APIs
  3. CharacterData
  4. remove()

Filter sidebar

In this article
  1. Document Object Model (DOM)
  2. CharacterData
  3. Instance properties
    1. data
    2. length
    3. nextElementSibling
    4. previousElementSibling
  4. Instance methods
    1. after()
    2. appendData()
    3. before()
    4. deleteData()
    5. insertData()
    6. remove()
    7. replaceData()
    8. replaceWith()
    9. substringData()
  5. Inheritance
    1. Node
    2. EventTarget
  6. Related pages for DOM
    1. AbortController
    2. AbortSignal
    3. AbstractRange
    4. Attr
    5. CDATASection
    6. Comment
    7. CustomEvent
    8. DOMError Deprecated
    9. DOMException
    10. DOMImplementation
    11. DOMParser
    12. DOMPoint
    13. DOMPointReadOnly
    14. DOMRect
    15. DOMTokenList
    16. Document
    17. DocumentFragment
    18. DocumentType
    19. Element
    20. Event
    21. EventTarget
    22. HTMLCollection
    23. MutationObserver
    24. MutationRecord
    25. NamedNodeMap
    26. Node
    27. NodeIterator
    28. NodeList
    29. ProcessingInstruction
    30. Range
    31. StaticRange
    32. Text
    33. TextDecoder
    34. TextEncoder
    35. TimeRanges
    36. TreeWalker
    37. XMLDocument
  7. Guides
    1. Introduction to the DOM
    2. Using the Document Object Model
    3. Attribute reflection
    4. Traversing an HTML table with JavaScript and DOM Interfaces
    5. Locating DOM elements using selectors
    6. Working with events
    7. Examples of web and XML development using the DOM
In this article CharacterData: remove() method

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

The remove() method of the CharacterData removes it from its parent node. If it has no parent node, calling remove() does nothing.

Syntax

js

remove()
Parameters

None.

Return value

None (undefined).

Example Using remove()

html

<span>Result: </span>A long string.

js

const span = document.querySelector("span");
const textNode = span.nextSibling;

textNode.remove(); // Removes the text
Specifications Specification DOM
# ref-for-dom-childnode-remove①
Browser compatibility See also Help improve MDN Was this page helpful to you? Learn how to contribute

.

This page was last modified on Jul 26, 2025 by MDN contributors.

View this page on GitHub

•

Report a problem with this content

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