Greg,
#match doesn''t accept comma-separated selectors (yet), but
#findElement does:
var link = e.findElement(''a.foo, a.bar''); // find a.foo or
a.bar
if (!link) return;
Best,
kangax
On Feb 21, 11:33 am, G Jones
<greg.jo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I have a series of elements, some with classname ''foo''
and some with
> classname ''bar''. When an event gets fired on the
container, I want to
> check whether it''s on either of these classnames to actually take
> action, so I test:
>
> var link = e.findElement(''a'');
> if(!link || !link.match(''.foo, .bar'')) { return; }
>
> For the elements with the classname ''foo'' this works
fine, but the
> call to .match() fails for those with classname ''bar''.
Should it not
> match for both?
>
> http://pastie.caboo.se/155443will maybe illustrate what I mean
>
> calling $$(''.foo, .bar'') returns all the elements
I''d expect it to,
> but not in the document-order that the docs for $$ suggest they would
> be.
>
> Greg
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---