JavaScript DOM -Replace

  • Element.replaceWith(replacement1, replacement2, ...)
    prefer over replaceChild - replaces element with specified replacement(s)
  • Node.replaceChild(newChild, oldChild)
    really odd syntax. New child is specified first
  • Element.replaceChildren(replacement1, replacement2, ...)
    clears all existing children and replaces them with the specified element(s)
Last updated: 5/5/2023 11:25:41 AM

Latest Updates

© 0 - 2025 - Mike Brind.
All rights reserved.
Contact me at Mike dot Brind at Outlook.com