怎样获取所有的script节点

1. 使用document.scripts;

document.scripts instanceof HTMLCollection;
// true

 

2. 使用 document.getElementsByTagName();

document.getElementsByTagName("script");

 

3. 使用 document.querySelectorAll();

document.querySelectorAll("script");

 

posted on 2019-09-17 14:38  aisowe  阅读(617)  评论(0编辑  收藏  举报

导航