Let's say I want to find all div
elements and span
inside p
.
Is it possible to get all what I want in a single querySelectorAll
invocation?
Conceptually it should be something like document.querySelectorAll("div | p span")
(where | means or).
document.querySelectorAll("p div, p span")
– Sexlimitedspan
elements insidep
and alldiv
elements throughout the DOM. – Sexlimited