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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s