1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-20 01:46:15 -04:00
elinks/test/ecmascript/assert/document.querySelector.html

25 lines
486 B
HTML
Raw Normal View History

2024-05-05 07:28:56 -04:00
<!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.');
2024-05-05 07:28:56 -04:00
}
console.error('document.querySelector.html');
myFunction();
console.exit(0);
</script>
</body>
</html>