Error Failed to execute removeChild on Node The node to be removed is not a child of this node
This error occurs when you try to remove a node from a parent node, but the node you are trying to remove is not actually a child of that parent node.
For example, let's say you have a div element with an id of "parent", and you want to remove a child element with an id of "child". If "child" is not actually a child element of "parent", you will get this error when you try to remove it using the removeChild() method.
To fix this error, make sure that the node you are trying to remove is actually a child of the parent node. You can check this by using the contains() method to see if the parent node contains the child node before attempting to remove it
原文地址: https://www.cveoy.top/t/topic/cf2Q 著作权归作者所有。请勿转载和采集!