title: Javascript countdown timer gets stuck after 1 sec
body: <p>I need to create a javascript countdown timer, I've been trying to do it using setInterval method but when I pass the seconds as a parameter it keeps looping so that it only goes down by 1 second then stops. Here is my code: </p>
  
  <p><strong>JavaScript :</strong></p>
  
  <pre><code>var second = 120;
  document.getElementById('timer').innerHTML = second;
  function setTimer(second)
  {
      second--;
      document.getElementById('timer').innerHTML = second;
      return second;
  }
  second = window.setInterval(setTimer, 1000, second); //Timer for user display
  </code></pre>
  
  <p>Thanks! </p>