javascript - How to implement show more button on my page using js/jquery show/hide -


i have page contains 40 items. don't want 40 stories displayed on 1 page @ time. don't have ajax knowledge. without using ajax how can implement show more functionality on page show 10 items @ time on page using pure jquery/js hide() or show() , not ajax?

try:

html:

<div id="text1">text</div> <div id="text2">text</div> <div id="text3">text</div>     <div id="text4">text</div> <br><br> <div id="button">show more</div> 

jquery:

 var count=2;  $( "#button" ).click(function() {  $( "#text"+count ).show();  count++;         }); 

demo


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -