As a click to reload the content?

How to make clicking the button "Load more articles" loaded one more round "news__article" (in red), and the button was pushed below, and so actually to 5 articles would fetch?
March 19th 20 at 08:48
2 answers
March 19th 20 at 08:50
Solution
https://codepen.io/anon/pen/OqYayL
so for a quick hand are added to the DIVS that already lies article, but I think the principle is clear, then it is not difficult to change
March 19th 20 at 08:52
Solution
$('.article__more_btn').on('click', function(){
 var blockArticle = '<article class="news__article d-flex flex-nowrap">.....</article>';
$(this).before(blockArticle);
});
Thanks for the solution! And do not tell yet, after a few additions of blocks to remove the load? - Geovanny_Nikola commented on March 19th 20 at 08:55
@Geovanny_Nikola, Well, you need to understand the total number of blocks and it will be a constant number or will change - elva commented on March 19th 20 at 08:58
@elva, I think that is permanent - Geovanny_Nikola commented on March 19th 20 at 09:01
@Geovanny_Nikola, then with each click, we believe the total number of article.news__article d-flex flex-nowrap and if it is equal to the total number of blocks, then $(this).hide(); something Like this in General - elva commented on March 19th 20 at 09:04
@elva, thank you again!)) - Geovanny_Nikola commented on March 19th 20 at 09:07

Find more questions by tags JavaScript