如何获取类似于使用document.body获取BODY的HTML元素?

Zoo*_*der 2 javascript dom

我知道有办法做到这一点,但我不记得是怎么回事.

我如何使用纯JavaScript来抓取HTML元素(DOM中最顶层的元素)?

Dig*_*ane 6

使用document.documentElement.

请参阅文档:https://developer.mozilla.org/en/document.documentElement