How to find an element inside another element in mootools

Let's say I need to find all the elements .barinside the element assigned to the variable foo.

JQuery foo.find('.bar')solves the problem.

What is the equivalent function in mooTools?

+3
source share
1 answer
<div id="container">
    <span class="elems">...</span>
    <span class="elems">...</span>
    ...
</div>

----

var elems = $('container').getElements('.elems');
// elems is now an array containing all spans with the class 'elem'

Or:

var elems = $$('#container.elems');
+8
source

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


All Articles