最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to find an element inside another element in mootools - Stack Overflow

programmeradmin5浏览0评论

Let's say i need to find all .bar elements inside an element that's assigned to a variable foo.

In jQuery, foo.find('.bar') solves the problem.

What's the equivalent function in mooTools?

Let's say i need to find all .bar elements inside an element that's assigned to a variable foo.

In jQuery, foo.find('.bar') solves the problem.

What's the equivalent function in mooTools?

Share Improve this question asked Mar 5, 2010 at 12:48 Leonid ShevtsovLeonid Shevtsov 14.2k9 gold badges55 silver badges86 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8
<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');
发布评论

评论列表(0)

  1. 暂无评论