1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00
elinks/test/ecmascript/assert/nodelist.forEach.html

23 lines
434 B
HTML
Raw Normal View History

2024-05-07 11:24:13 -04:00
<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);
2024-05-07 11:24:13 -04:00
var counter = 0;
birds.forEach(function(b) {
counter++;
});
console.assert(counter === 3, counter);
2024-05-07 11:24:13 -04:00
console.exit(0);
</script>