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');
|
|
|
|
|
2024-06-24 10:50:08 -04:00
|
|
|
console.assert(birds.length === 3, 'birds.length');
|
2024-05-07 13:33:34 -04:00
|
|
|
|
2024-05-07 11:24:13 -04:00
|
|
|
var counter = 0;
|
|
|
|
birds.forEach(function(b) {
|
|
|
|
counter++;
|
|
|
|
});
|
2024-05-07 13:33:34 -04:00
|
|
|
console.assert(counter === 3, counter);
|
2024-05-07 11:24:13 -04:00
|
|
|
|
2024-06-01 07:30:03 -04:00
|
|
|
console.exit();
|
2024-05-07 11:24:13 -04:00
|
|
|
|
|
|
|
</script>
|