When removing an element with standard JavaScript, you must go to its parent first: 使用标准JavaScript删除元素时,必须首先转到其父元素: node
var element = document.getElementById("element-id"); element.parentNode.removeChild(element);
Having to go to the parent node first seems a bit odd to me, is there a reason JavaScript works like this? 首先必须去父节点对我来讲有点奇怪,JavaScript是否有这样的缘由? 服务器