title: how can i make pages ,each one contains 10 posts?
body: <p>I've got 100 posts with Fetch API, I have all of them on the same page.
  I have no idea how can i make pages where each page i can display 10 posts only .</p>
  
  <p>Thats my javascript code:</p>
  
  <pre><code>      fetch('https://jsonplaceholder.typicode.com/posts')
         .then((res)=&gt;res.json())
         .then((data)=&gt;{
         let output = '&lt;h2 class="posts"&gt;&lt;/h2&gt;';
         let i=0;
         data.forEach(function(thePost){
          output += `
           &lt;div style="background-color: gray;margin- 
         right:60px;width:300px;height:350px;border-radius: 30px;display: 
         inline-block;overflow: hidden;"  class="post" id=item${i}&gt;
            &lt;h3 style="padding:10px;color:white;"&gt;${thePost.title}&lt;/h3&gt;
            &lt;p style="padding:10px;color:white;"&gt;${thePost.body}&lt;/p&gt;
          &lt;/div&gt;
        `;
        i++;
        //if (i==3){`&lt;br&gt; &lt;br&gt;`}
      });
      document.getElementById('posts').innerHTML=output;
  
  });
  </code></pre>
  
  <p>These are the div posts:<a href="https://i.stack.imgur.com/DqEOj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DqEOj.png" alt="div posts"></a></p>