Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /dom/nodes/ParentNode-querySelector-nested.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>querySelector on multi-level query selecting</title>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div>
<span id="span1">Actions</span>
<ul>
<li>
<a href="/">
<span id="span2">Link</span>
</a>
</li>
</ul>
</div>
<script>
"use strict";
test(() => {
const target = document.getElementById("span2");
const anchor = document.querySelector("a");
const span = anchor.querySelector("span");
assert_equals(span, target);
});
</script>