blob: c0272ca3f4792c8782eb57b91aaab83b3f15d472 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<!doctype html>
<title>HTMLCollection test</title>
<div id="result">Fail</div>
<script src=asserts.js></script>
<style>style 1</style>
<style>style 2</style>
<style>style 3</style>
<script>
const abc = document.all;
assert(!document.all, "document.all must be falsy");
assert(!abc, "document.all must be falsy");
assert_equals(document.all.length, 10);
const styles = [abc[6], abc[7], abc[8]];
assert_equals(styles[0].textContent, "style 1");
assert_equals(styles[1].textContent, "style 2");
assert_equals(styles[2].textContent, "style 3");
const result = document.getElementById("result");
result.textContent = "Success";
</script>
|