The answer is similar to the Deonis answer, but using the selector on children
and :not(:visible):
Js:
$('#showNext').click(showOneElementInEachSection); var sect=$('section'); function showOneElementInEachSection() { sect.each(function () { $(this).children('.hidden-item:not(:visible)').first().fadeIn(100); }); }
demo
the second option is to remove the class:
$('#showNext').click(showOneElementInEachSection); var sect=$('section'); function showOneElementInEachSection() { sect.each(function () { $(this).children('.hidden-item').first().removeClass('hidden-item'); }); }
demo