1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[assert] document.querySelector

This commit is contained in:
Witold Filipczyk 2024-05-05 13:28:56 +02:00
parent f2fbde2de7
commit be67094940

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<body>
<p class="a">Class a.</p>
<p class="b">Class b.</p>
<script>
function myFunction() {
var x = document.querySelector('.nonexistent');
console.assert(x === null, 'nonexistent element');
var y = document.querySelector('.b');
console.assert(!(y === null), 'Class b');
}
console.error('document.querySelector.html');
myFunction();
console.exit(0);
</script>
</body>
</html>