title: How to increment variable on click and update content from JSON?
body: <p>I'm building a app to show the fixture off a football club. I have a json file with the data of the games and can show this based on the current week.</p>
  
  <p>I want to make it possible to show the next game and a game before after click on the link.</p>
  
  <p>I tried a lot but can't realize this.</p>
  
  <p>To get the current week and show the match:</p>
  
  <pre><code>currentWeek = data[0].current_week;
  day = data[0].weeks[currentWeek].day;
  
  homeTeam = data[0].weeks[currentWeek].team1;
  awayTeam = data[0].weeks[currentWeek].team2;
  scoreHome = data[0].weeks[currentWeek].score1;
  scoreAway = data[0].weeks[currentWeek].score2;
  </code></pre>
  
  <p>I tried this to update the current week, but doesn't work:</p>
  
  <pre><code>$( "#test" ).click(function() {
          currentWeek++;
      });
  </code></pre>
  
  <p>Link:
  <a href="https://jsfiddle.net/gjm9yjoj/" rel="nofollow noreferrer">https://jsfiddle.net/gjm9yjoj/</a></p>
  
  <p>How can I show the next game after clicking on </p>
  
  <pre><code>&lt;li&gt;&lt;a href="" id="test"&gt;WEEK LATER&lt;/a&gt;&lt;/li&gt;
  </code></pre>