Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个存储大量 DOM 数据的小书签,但我希望避免将它们放在 body 标记之外,这样页面中的脚本就不会弄乱它。
语义值一次不是问题,但我想知道:
<html> 标签内的所有内容(即使在 <body> 标签外)都可以通过document.documentElement.
document.documentElement
一些小测试的结果:
</body>
alert()