跳到主要内容

使用api获取页面DOM元素数量

通过 Google Chrome 控制台快速验证 DOM 大小,只需输入 document.querySelectorAll("*").length 脚本,就能知道当前网页状况。

document.querySelectorAll("*").length