title: infinite loop showing random numbers js
body: <p>My code is not working as I want to. It must show a random number but changes every some milliseconds that doesn't stop.</p>
  
  <p>Here's the DOM:</p>
  
  <pre><code>&lt;p&gt;Random number:&lt;/p&gt;
  &lt;p id="random_number"&gt;&lt;/p&gt;
  </code></pre>
  
  <p>And my script:</p>
  
  <pre><code>var random_script = function() {
      while (true) {
          setTimeout(function(){
             var t = Math.round(Math.random() * (100 - 1) + 1);
             document.getElementById("random_number").innerHTML = t;
          }, 1000);
      }
  }();
  </code></pre>
  
  <p>But chrome keeps on crashing. Any help please?</p>