Does removeChild really delete the element?

后端 未结 4 1608
深忆病人
深忆病人 2020-12-16 18:13

Does removeChild function really delete the child node completely? Or it just removes the element being child of the specified parant node? If it doesn\'t reall

4条回答
  •  时光取名叫无心
    2020-12-16 18:27

    This will completely delete the node:

    someNode.removeChild(...);
    

    This will remove the node from the DOM so it's not visible but will save it so that you can insert it elsewhere:

    oldNode = someNode.removeChild(...);
    

提交回复
热议问题