为什么在 Internet Explorer(版本 11 及以下)中更改 innerText 会永久破坏所有后代文本节点?

Why does altering innerText in Internet Explorer (version 11 and below) permanently destroys all descendant text nodes?

Node.textContent 的 MDN 文档如下:

Both textContent and innerText remove child nodes when altered, but altering innerText in Internet Explorer (version 11 and below) also permanently destroys all descendant text nodes. It is impossible to insert the nodes again into any other element or into the same element after doing so.

在 IE 中,在更改 innerText 时销毁所有后代文本节点的目的是什么?

找了很多,才发现这个解释是有道理的。讲的是innerHTML,但我觉得innerText也是一样的:在IE中,innerText是DHTML(不是DOM)的特性,也是一种低级的破坏方法。

毕竟,IE 使用与其他浏览器不同的 JavaScript 引擎。所以实现也会有所不同。

参考link:Why does IE discard the innerHTML/children of a DOM element after DOM changes?