I think your issue is that 'answer_submit_class' is a CSS selector for
a html *tag* answer_submit_class, and one doesn't exist. What I think
you're looking for is '.answer_submit_class' (note the dot at the
beginning).

Just for reference, I think that last example you gave will never
work... I think there is some confusion between Fx.Elements and
elements there.

Michal.

On Jan 9, 12:58 pm, Zaphod Beeblebrox <[email protected]> wrote:
> Sorry if my question in doesn't good place.
>
> I try too add event to collection of input, this code work perfectly
> for one
>
>         var dialog_msg = function(){ alert('Foo'); }
>         $('answer_submit_id').addEvent('click', dialog_msg);
>
> but when i try this, doen't work :-(
>
>         $$('answer_submit_class').addEvent('click', dialog_msg);
>
> or this
>
>         $$('answer_submit_class').each(function(stuffButton) {
>             stuffButton.addEvent('click',function(){
>                 alert('Yep');
>             });
>         });
>
> or this
>
>         var myFx = new Fx.Elements($$('input.answer_submit_class')).set({
>                  'click': function(){
>                         alert('click');
>                     }
>         });
>
> and many other ...
>
> in other word, i can't do apply an event to collection of element. and
> i nothing find in dochttp://mootools.net/docs/
>
> Anybody for help me ?!
> Thanks.

Reply via email to