title: setInterval() not working
body: <p>I am trying to run a function at <code>setInterval()</code> of "1 second", but it is a bit problematic. I have done everything as shown <a href="http://www.w3schools.com/js/js_functions.asp" rel="nofollow">here</a> but it doesn't work.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>&lt;script&gt;
     function test(db_time)
     {
        var c_db_time= db_time/1000; 
        var current_time = new Date().getTime()/1000;
        return Math.round(current_time - c_db_time);
     }
     $(".elapsed_time").each(function() {
        var time_r = $(this).data('time_raw');
        var inter = $(this).html(time_ago(time_r));//parameter to function
  
        setInterval(inter,1000)
     });
  &lt;/script&gt;
  </code></pre>
  
  <p>And the error is :<b>Uncaught SyntaxError: Unexpected identifier</b></p>
  
  <hr>
  
  <p><b>Solution found </b>thanks to @Bommox &amp; @Satpal</p>
  
  <pre><code> $(".elapsed_time").each(function() {
  var time_r = $(this).data('time_raw');
      var self = $(this);
      var inter = function() {self.html(time_ago(time_r));}
      setInterval(inter, 1000);
    });
  </code></pre>