Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /dom/nodes/querySelector-empty-id.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>querySelectorAll matching empty id attribute</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="root">
<div id=""></div>
<div id></div>
<div></div>
</div>
<script>
test(() => {
assert_equals(root.querySelectorAll("[id]").length, 2);
assert_equals(root.querySelectorAll("[id='']").length, 2);
}, "querySelector attribute matching empty id");
</script>