3 <script src=
"../../../resources/js-test.js"></script>
7 <div name='name1' id='id1'
/>
8 <div name='name2' id='id2'
/>
9 <div name='name3' id='id2'
/>
12 description("Test getElementById");
16 // element found with exact match
17 elem
= document
.getElementById('id1');
18 shouldBe('elem.getAttribute("name")', '"name1"');
20 // multiple elements having same id return the first one
21 elem
= document
.getElementById('id2');
22 shouldBe('elem.getAttribute("name")', '"name2"');
24 // element with id not found
25 elem
= document
.getElementById('id3');