18 Answers
New AnswerI would like to create a load more button on my webpage but I am confused about how to access the html elements that I wanna load until there are no more elements to load. What I want to create is a load more button that loads more articles when a user clicks on it and it also load more articles if the user clicks on it again until there are no more article left to load Please help https://code.sololearn.com/WEW250M1Y8bl/?ref=app
11/23/2020 9:24:58 PM
M○|-|FΞY 🇳🇬18 Answers
New AnswerMofey check this. i hope this is what you looking for https://code.sololearn.com/Wj6RWKE87QTa/?ref=app
Okay Med Amine Fh What I want to create is a load more button that loads more articles when a user clicks on it and it also load more articles if the user clicks on it again until there are no more article left to load
Mofey are you using a computer or the phone ? it seems sololearn code playground not showing me the results as expected
Mofey you can use “document.querySelector("article:nth-child(1)");” https://code.sololearn.com/WQWRf21pIzTW/?ref=app
you can select by className or tagName , this return an array of nodes: document.querySelectorAll(".myclass") document.querySelectorAll("button")
For instance Med Amine Fh, check my code How can I substitute that of the articles for the one, two and so on without using html elements https://code.sololearn.com/WEW250M1Y8bl/?ref=app
Learn Playing. Play Learning
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message