That is a great solution if I have a few elements with class that starts with "test_" or ends with "_test". But what if I have 1,000 elements that start with "test_" or ends with "_test"? Do you really want me to do this: $$(.'test_1', 'test_2', ... 'test_1000') or $$('first_test', 'second_test', ... 'onethousand_test')?
On Thu, Dec 31, 2009 at 2:37 AM, Alex McAuley < webmas...@thecarmarketplace.com> wrote: > You can comma up your classes in the observer... > > $$('.test_1','.test_2','#some_id','.test_3').each(... > }); > > > HTH > Alex Mcauley > http://www.thevacancymarket.com > ----- Original Message ----- > From: "Frédéric" <f...@gbiloba.org> > To: <prototype-scriptaculous@googlegroups.com> > Sent: Thursday, December 31, 2009 10:30 AM > Subject: Re: [Proto-Scripty] How can I observe elements with > class="test_1", > "test_2", "test_3" or "first_test", "second_test", "third_test"? > > > On jeudi 31 décembre 2009, kimbaudi wrote: > > > Hi, I know how to observe elements with class="test". However, I would > > like to know how I would be able to observe elements with > > class="test_1", class="test_2" and class="test_3" or > > class="first_test", class="second_test" and class="third_test". Here > > is my pastie url that observes elements with class="test" and alerts > > the innerHTML of these elements: http://pastie.org/762352. Can someone > > please show me a code that will alert the innerHTML of elements that > > have classes "test_1", "test_2", "test_3" and elements that have > > classes "first_test", "second_test", "third_test"? I am familiar w/ > > Javascript to know that this is possible but unfamiliar w/ Javascript > > to know how to achieve this. > > A simple-but-not-smart way is to parse all dom elements and observe all id > containting 'test'... > > -- > Frédéric > > -- > > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > prototype-scriptacul...@googlegroups.com. > To unsubscribe from this group, send email to > prototype-scriptaculous+unsubscr...@googlegroups.com<prototype-scriptaculous%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > > > > -- > > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > prototype-scriptacul...@googlegroups.com. > To unsubscribe from this group, send email to > prototype-scriptaculous+unsubscr...@googlegroups.com<prototype-scriptaculous%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.