mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
22 lines
459 B
HTML
22 lines
459 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('element.matches');
|
|
|
|
var birds = document.getElementsByTagName('li');
|
|
|
|
for (var i = 0; i < birds.length; i++) {
|
|
if (birds[i].matches('.endangered')) {
|
|
console.assert(birds[i].textContent === 'Philippine eagle', 'endangered');
|
|
}
|
|
}
|
|
|
|
console.exit(0);
|
|
|
|
</script>
|