When using $$ in Prototype, the result is an array. You need to loop through the array to attach the observe function. Expl.
$$(‘.myitems‘).each(function(item) { item.observe(‘click’,function(){alert (‘clicked’)});});

or

$$(‘.myitems’).invoke(‘observe’, ‘click’, function() {alert(‘clicked’)});

Leave a Reply

Your email address will not be published. Required fields are marked *