$ returns an array when given more than one id. You could then use
invoke on that array to add class to each element.
$(''div1'', ''div2'', ''div3'',
''div4'').invoke(''addClassName'',
''someClass'');
http://www.prototypejs.org/api/utility/dollar
http://www.prototypejs.org/api/enumerable/invoke
- kangax
On Mar 1, 4:19 pm, Tarscher
<tarsc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi all,
>
> I want to use the addClassName on different divs. Can I do something
> like
> (''div1'', ''div2'',
''div3'',
''div4'').each.addClassName(''class'') ?
>
> Regards,
> Stijn
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---