yeah, I know how to do that, what I need to do is apply an each function on the children elements of a certain class.
This my entire code right now, but it relys on a spefic id to do it
Code:
function accordion(){
var children = $('accordion').childElements();
var i = 1;
children.each(function(a) {a.setAttribute("value", i++);
if (i % 2 == 0) {a.setStyle({backgroundColor: '#d4d4d4', padding:'0px 0px 0px 50px'});
a.insert(Builder.node('div', {className: 'arrow'}))};
if (i % 2 == 1) {Effect.BlindUp(a, {duration:0.5})};
$$('.arrow').invoke('observe', 'click', function(){
Effect.toggle(this.parentNode.next(),'slide', { duration: 0.5});
});
$$('.left').each(function(l){l.setStyle({textAlign:'left'})})
$$('.right').each(function(r){r.setStyle({textAlign:'right'})})
})
}
the bold part needs to select all the child elements of any element with the class 'accordion'