3 <script src=
"../../../resources/js-test.js"></script>
6 <p id=
"description"></p>
7 <div id='div1'
>text1
</div>
8 <div id='div2'
>text2
</div><br>
10 <div id=
"console"></div>
13 description('This tests that items in a NodeList can be retrieved directly by name.');
15 var NodeList
= document
.getElementsByTagName('div');
16 var div1
= NodeList
.div1
;
17 var div2
= NodeList
.div2
;
19 shouldBeTrue("div1 instanceof HTMLDivElement");
20 shouldBeTrue("div2 instanceof HTMLDivElement");
21 // Also check that the correct divs were retrieved.
22 shouldBe("div1.innerHTML", "'text1'");
23 shouldBe("div2.innerHTML", "'text2'");