javascript - How to use a 'this' in the selector in queryselectorall -


is possible use kind of 'this' in selector in queryselectorall()?

explanation: if use:

var _childlist = document.queryselectorall("#treeic > li"); 

i got result wish first level in tree.

but if use:

var _ictree = document.getelementbyid("treeic"); var _childlist = _ictree.queryselectorall("li"); 

i got li tags nested down tree. if wrote:

var _childlist = _ictree.queryselectorall("> li"); // or var _childlist = _ictree.queryselectorall("this > li"); 

it doesn't work.

i need use recursive call in implementation , why need it. know how workaround, know if there way use 'this' in queryselectorall() , write more clean code.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -