mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
[assert] element.matches (failed)
This commit is contained in:
parent
61362206c7
commit
236bfb5964
21
test/ecmascript/assert/element.matches.html
Normal file
21
test/ecmascript/assert/element.matches.html
Normal file
@ -0,0 +1,21 @@
|
||||
<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>
|
Loading…
Reference in New Issue
Block a user