When using querySelectorAll, is there a way to reference the immediate children of the context node, without using IDs?
问题 Say I have an HTML structure like <div id="a"> <div id="b"> <div id="c"></div> </div> </div> To do a query for the children of "a" using querySelectorAll I can do something like //Get "b", but not "c" document.querySelectorAll('#a > div') My question is : is it possible to do this without the ID, referencing the node directly? I tried doing var a_div = document.getElementById('a') a_div.querySelectorAll('> div') //<-- error here but I get an error telling me that the selector I used is