title: Need help understanding Javascript setinterval and function declaration
body: <p>I am very new to js and jquery  and need help understanding why this script does not work. I've checked it over any number of times, but in all my research, there is something that I am missing. Any help would be appreciated.  The code should just set text value in div once every 2 seconds. I cut this code down from its real functionality so ignore the fact that it does nothing.  Forgive and correct me if I am not posting this properly. It's my first post.
  code below:   </p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"&gt;
      &lt;/script&gt;
      &lt;script type="text/javascript"&gt;
        var test=0;
        var timer = setInterval(save_it(), 2000);
        var test=0;
          $(document).ready(function(){
            var save_it = function(){
              testdiv.innerhtml = test++;
            };
          });
       &lt;/script&gt;
    &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="testdiv"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p></p>