title: How do i get data from json based on which ul li id is clicked?
body: <p>This is my first project for website, but i decide to ask this, because i am not sure how to begin, despite watching countless of tutorials.</p>
  
  <p>I have ul list items like this</p>
  
  <pre><code>&lt;li&gt;&lt;a href="posts.html?id=1"&gt;Data for id 1&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="posts.html?id=2"&gt;Data for id 2&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>And json.file like this</p>
  
  <pre><code>{
   "posts": [{
    "id": 1,
    "postId": 1,
    "img":"",
    "title": ""
  }]
  }
  </code></pre>
  
  <p>I want this json to be filled with lots of objects and i want to get this by postId</p>
  
  <p>I have no idea how to id.Everything i find is with Angular/React and i am still learning basic JS/Ajax</p>
  
  <p>So, if i click li with  ?id=1...to get all json data with "postId"</p>