admin管理员组文章数量:1434949
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">
<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.
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">
<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.
Share Improve this question edited Jan 11, 2010 at 13:10 Nir asked Jan 11, 2010 at 11:35 NirNir 4,0138 gold badges39 silver badges53 bronze badges2 Answers
Reset to default 1var divsB = $$("div.a div.b");
http://mootools/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");
本文标签: javascriptMootoolsselecting a DOM element by its classesStack Overflow
版权声明:本文标题:javascript - Mootools - selecting a DOM element by its classes - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745624981a2666917.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论