title: jQuery - clearInterval seems not to work
body: <p>Long story short: If the interval count exceeds 5 the code should clear the interval, stopping it from executing the function every second. But this doesn't seem to work.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id='feedback'&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>JavaScript / jQuery</strong></p>
  
  <pre><code>window.intervalcount = 0;
  
  var interval = setInterval(function () {
      intervalcount += 1;
      $("#feedback").text(intervalcount);
  }, 1000);
  
  if(intervalcount &gt; 5) {
      clearInterval(interval);
  }
  </code></pre>
  
  <p>But I can't seem to find the issue...</p>