1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-27 01:25:34 +00:00
elinks/test/ecmascript/assert/document.querySelector.html
2024-06-01 13:30:03 +02:00

25 lines
485 B
HTML

<!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');
var inp = y.innerHTML;
console.assert(inp === 'Class b.', 'Class b.');
}
console.error('document.querySelector.html');
myFunction();
console.exit();
</script>
</body>
</html>