If you had read the next sentence of my comments you would have seen that it would be a "few more lines" if you didn't use jQuery, basically you need a function like:
function eachItem(arrayLike, cb) {
return [].slice.call(arrayLike).forEach(cb);
}
So 3 more lines. If I said you can write a very verbose accordion in under 20 lines would that be good enough for you?