title: Why is the jquery loop not working
body: <p>I know I sound like an idiot right now but I cant find why I never get the number 0 in the loop.</p>
  
  <p><strong><a href="http://jsfiddle.net/7uSAN/5/" rel="nofollow">http://jsfiddle.net/7uSAN/5/</a></strong></p>
  
  <pre><code>var timer = 0;
  
  setInterval(function() {
        if (timer == 1)
        {
            var timer = 0;
            $("#box").html(timer);
        }
        else
        {
            var timer = 1;
            $("#box").html(timer);
        }
  }, 1000);
  </code></pre>