javascript - How do I show N divs every time user clicks same button? -
let's suppose have 18 divs 4 of them visible, below "see more" button. i'd show next 4 divs when user clicks button, , repeat process until there no more divs display. possible? wasn't able find answer , solve either.
here working example you. basically, on click need remove hidden class on div.
$(function(){ $("#showmore").on("click", function() { var hiddendivs = $('div.hidden'); if (hiddendivs.length > 0) { hiddendivs.slice(0,4).removeclass('hidden'); } }) });
Comments
Post a Comment