But how do you get to the children???

So by now everyone pretty much knows about dojo.query(), the powerful function search a DOM for elements. But, did you know you can also use a syntax to get the immediate child elements of query? Yep, this hidden little gem is very powerful, you simply add a “>” at the end of the query. So the same supported queries plus this sign simply returns the immediate children of the result.

dojo.query('#main > *')
dojo.query('#main >')
dojo.query('.foo >')
dojo.query('.foo > *') - link

You should check out the documentation, you can use dojo.query() with many different variations to get all kinds of different results.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.