→、
Document 中の <script> 要素のリストを HTMLCollection で返します。
HTMLCollection。
ページ内の <script> 要素の存在を確認する例を以下に示します。
let scripts = document.scripts; if (scripts.length) { alert("このページには script 要素があります。"); }