title: How can I make an interval timer?
body: <p>I have the bootstrap loading bar:</p>
  
  <pre><code>  &lt;div class="progress"&gt;
    &lt;div class="progress-bar progress-bar-success progress-bar-striped active" id="loading" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 0%"&gt;
    &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>I'm trying to change the width of the bar every few seconds so it looks like the bar is making progress.</p>
  
  <p>I have this but it's not working:</p>
  
  <pre><code>   setInterval(function () {
        var percentl = percentl + 5;
        document.getElementById("loading").style.width = percentl + "%";
    }, 1000);
  </code></pre>