开发者

Mootools each on childs

I am working on a script what uses MooTools, and i want to select all input's in one element, but the problem is that I don't know the ID of the ele开发者_C百科ment, the element is a variable. (In The function is formElement = $('form#aForm'))

Does someone know how I can use the each function on all input in one element. Now I am using:

$$('input').each(function(el) {
    alert(el.get('value'));
});

But this script uses all elements in the document, and I want use only the elements in formElement. How is this possible?

Tom

PS: Sorry for my bad English.


Use Element.getElements:

formElement.getElements('input').each(function(el) {
    alert(el.get('value'));
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜