Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / NodeList / nodelist-item-with-name.html
bloba61dc8328049541529a6a65aff6a50e473bc8dda
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <p id="description"></p>
7 <div id='div1'>text1</div>
8 <div id='div2'>text2</div><br>
10 <div id="console"></div>
12 <script>
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'");
24 </script>
25 </body>
26 </html>