title: unable to refresh DOM element while heavy javascript calculation goes
body: <p>I want to refresh a span element before my calculations start to inform user that calculation was started.</p>
  
  <p>the following code never displays <em>'calculating'</em> message:
      
      
      
      
      </p>
  
  <pre><code>&lt;script&gt;
      document.getElementById('text').innerHTML = 'calculating';
      for (var i=0; i&lt;9999;i++){
          var y = Math.pow(i,i);
          console.log(y);
      }
      document.getElementById('text').innerHTML = 'done'; 
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>how to fix that?</p>
  
  <p><strong>Guys, setTimeout is not an option for me. besides it looks ugly.</strong></p>