Kangax, I have still not understood this.
The following works but why? I do not use el which references the clicked element .. document.observe('click', function(e, el) { if (el = e.findElement('.sectionform')) { // do stuff. `el` now references clicked element e.stop(); getData(e.element().form); } }) Cheers Geoff On Jan 16, 1:06 am, kangax <kan...@gmail.com> wrote: > On Jan 15, 6:15 pm, "Richard Quadling" <rquadl...@googlemail.com> > wrote: > > [...] > > > You could add the same class to each element and ... > > > $$('.classname').invoke('observe', 'click', function(ev) { ... }); > > Not a good idea with many elements. Better would be: > > document.observe('click', function(e, el) { > if (el = e.findElement('.classname')) { > // do stuff. `el` now references clicked element > } > > }); > > [...] > > -- > kangax --~--~---------~--~----~------------~-------~--~----~ 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-scriptaculous@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 -~----------~----~----~----~------~----~------~--~---