What is the Dojo jQuery Area Attribute Equivalent?

In jQuery, a DOM node or jQuery object can be passed as an attribute in a query that sets the scope:

var myScope = $('#someDiv'); $('a',myScope).addClass('red'); $('li',myScope).css('display','inline'); 

Now, in Dojo, I can bind several .query() one after another, but what should I do if I have a specific DOM node - not nodeList - that I want to use as a scope?

Kthnx

+4
source share
1 answer

It is just like jQuery. The query() method has an additional parameter that can be used as a scope:

 dojo.query("#someDiv", scope) 

Where scope can be an identifier of an element or a DOM node.

See the Dojo documentation for more information.

+5
source

Source: https://habr.com/ru/post/1305113/


All Articles