Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>Node.prototype.getElementsByClassName with no real class names</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<span class=" ">test</span>
<script>
"use strict";
test(() => {
const elements = document.getElementsByClassName("");
assert_array_equals(elements, []);
}, "Passing an empty string to getElementsByClassName should return an empty HTMLCollection");
test(() => {
const elements = document.getElementsByClassName(" ");
assert_array_equals(elements, []);
}, "Passing a space to getElementsByClassName should return an empty HTMLCollection");
test(() => {
const elements = document.getElementsByClassName(" ");
assert_array_equals(elements, []);
}, "Passing three spaces to getElementsByClassName should return an empty HTMLCollection");
</script>