var currentLoad = 9; $(document).ready(function() { $('.newsOverviewBlock .item:lt('+ currentLoad + ')').addClass('active'); checkButton(); $(document).on("click",".newsOverviewBlock .loadMore", function() { currentLoad = currentLoad + 4; $('.newsOverviewBlock .item:lt('+ currentLoad +')').addClass('active'); checkButton(); }); }); function checkButton(){ if($(".newsOverviewBlock .item").length <= currentLoad){ $(".newsOverviewBlock .loadMore").hide(); } }