1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00
elinks/test/ecmascript/assert/nodelist.forEach.html
2024-05-07 19:33:34 +02:00

23 lines
434 B
HTML

<ul id="birds">
<li>Orange-winged parrot</li>
<li class="endangered">Philippine eagle</li>
<li>Great white pelican</li>
</ul>
<script type="text/javascript">
console.error('nodelist.forEach.html');
var birds = document.querySelectorAll('li');
console.assert(birds.length === 3, birds.length);
var counter = 0;
birds.forEach(function(b) {
counter++;
});
console.assert(counter === 3, counter);
console.exit(0);
</script>