title: How to increment a variable after 1 second in javascript
body: <p>The goal is to add 1 every second.  I am not sure about how to use <code>return</code> here, and how  to <code>return</code> the value of <em>secsUp</em> to <em>seconds</em>.</p>
  
  <pre><code>function timeDisp ()
  {
  var seconds=0;
  function changeSecs ()
      {
          var secsUp = seconds+1;
          return secsUp;
      }
  document.write(seconds);
  }
  setInterval(timeDisp,1000);
  </code></pre>