Test using the descendant combinator with the double-child syntax ">>" in Element.closest().

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS document.getElementById("target1").closest("body >> target").id is "target1"
PASS document.getElementById("target2").closest("body >> target").id is "target2"
PASS document.getElementById("target1").closest("body >> container").id is "container2"
PASS document.getElementById("target2").closest("body >> container").id is "container3"
PASS document.getElementById("target1").closest("container >> container").id is "container2"
PASS document.getElementById("target2").closest("container >> container").id is "container3"
PASS document.getElementById("target1").closest("target >> container") is null
PASS document.getElementById("target2").closest("target >> container") is null
PASS document.getElementById("container1").closest("target >> container") is null
PASS document.getElementById("container2").closest("target >> container") is null
PASS document.getElementById("container3").closest("target >> container") is null
PASS successfullyParsed is true

TEST COMPLETE

