blob: a61dc8328049541529a6a65aff6a50e473bc8dda [file] [log] [blame]
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<p id="description"></p>
<div id='div1'>text1</div>
<div id='div2'>text2</div><br>
<div id="console"></div>
<script>
description('This tests that items in a NodeList can be retrieved directly by name.');
var NodeList = document.getElementsByTagName('div');
var div1 = NodeList.div1;
var div2 = NodeList.div2;
shouldBeTrue("div1 instanceof HTMLDivElement");
shouldBeTrue("div2 instanceof HTMLDivElement");
// Also check that the correct divs were retrieved.
shouldBe("div1.innerHTML", "'text1'");
shouldBe("div2.innerHTML", "'text2'");
</script>
</body>
</html>