title: How to get the interval for setInterval from user
body: <p>The <code>setInterval</code> inside the function won't actually call the <code>fibo</code> function but the one outside does. <code>getinfo</code> is the function call when the button is press. I'm trying to use the interval information we get to the user to use it for the set <code>interval(fibo,userEnterInterval)</code></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" dir="ltr"&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;problems&lt;/title&gt;
      &lt;b id="series"&gt;hi&lt;/b&gt;
  
    &lt;/head&gt;
    &lt;body method="get"&gt;
      &lt;form method="post"&gt;
      &lt;label for="Range"&gt; Range(N): &lt;/label&gt;
        &lt;input id="Range" type="text" placeholder="Range" name="Range"&gt;
        &lt;label for="Interval"&gt; Interval in seconds &lt;/label&gt;
        &lt;input id="Interval" type="text"enter code here placeholder="Interval" name="Interval"&gt;
        &lt;input id="button" type="submit" onclick="getinfo()"  /&gt;
      &lt;/form&gt;
      &lt;script type="text/javascript"&gt;
  
        var fis = [];
        function getinfo(){
          var interv = document.getElementById('Interval').value;
          var range = document.getElementById('Range').value;
          range =range*1000;
          setInterval(fibo,1000 );
        }
        setInterval(fibo,1000 );
        var printS = document.getElementById('series');
        function fibo(){
            if(fis.length == 0){
              printS.textContent = '0 ';
              fis.push(0);
            }else if( fis.length == 1){
              alert(fis.length);
              printS.textContent += '1 ';
              fis.push(1);
              alert(fis.length);
            }else{
              var next = fis[fis.length-1] + fis[fis.length-2];
              printS.textContent +=next.toString() + ' ';
              fis.push(next);
            }
          }
  
  
  
  
  
      &lt;/script&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>