Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/dom/documents/dom-tree-accessors/document.scripts.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset=utf-8>
<title>Document.scripts</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
test(function() {
var scripts = document.scripts;
assert_true(scripts instanceof HTMLCollection);
assert_equals(scripts.length, 3);
var script = document.createElement("script");
document.body.appendChild(script);
assert_equals(scripts.length, 4);
document.body.removeChild(script);
assert_equals(scripts.length, 3);
}, "Document.scripts should be a live collection");
</script>