Is it possible to get the index of the element (eg) clicked when using
event delegation?

Here is my example code:


var comments=$$('.answer').hide();

document.id('faq').addEvent('click:relay(.question)', function(){
        // how to get the "index" of the item clicked so that this
next line will work?
       comments[index].show();
});


Code in mooshell:
http://mootools.net/shell/kss2C/

Thanks in advance for any suggestions, I am probably missing something
obvious :(

Chris

Reply via email to