How can I hide elements in my list and add a 'show more' feature?
问题 I'm using javascript to build a list of results. I have a for-loop that iterates over some data and creates a mydata div, and adds that to the results div. Let's pretend it looks something like this: <div id="results"> <div class="mydata">data 1</div> <div class="mydata">data 2</div> ... <div class="mydata">data 20</div> </div> What I want to do is only display 5 results at a time , and should the user wish to see more, they can click a show next 5 or show more button (or something similar).