I use MooTools, and I need to find the element which has both classes "a" and "b" (the innermost div in my example below).
The HTML structure is:
<div class="a">
<div class="otherclass"&g开发者_JS百科t;
<div class="b"></div>
</div>
</div>
In jQuery it's $("div .a .b"), as far as I know. What's the mootools syntax? I've tried
$$("div .a .b")
but it doesn't return any results.
Thanks!
-- To clear things, I want to get ONLY the divs which have both classes (in this case, only one.) thanks.
var divsB = $$("div.a div.b");
http://mootools.net/shell/jfnWK/ - selects the first one but not the second as it's not a child of a div.a
What about
$$('div.a div.b')
or
$$("div.a").getElements("div.b");
精彩评论