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

javascript - How do you prevent nested queries/catches in sequelize? -

java - Could not retrieve pre-bound Hibernate session - Could not obtain transaction-synchronized Session for current thread -

ruby on rails - ActiveRecord order not working -