when a line of code that updates the user interface is executed BEFORE of a block of code that keep the system busy for a while, the UI is not updated.
Please see the code below:

```html
 <html>
   <body>
    <div id="acc">
       <input type="text" value="start" id="id1"/>
       <input type="text" value="e0" id="id2"/>
    </div>
    <script>
      myFunction();
      function myFunction() {  
         document.getElementById("id1").value="1";
         var j=true;
         for(var i=0;j==true;i++){
            document.getElementById("id2").value="e"+i;  
            if(i==999999)
             j=false;
         }
         document.getElementById("id1").value="2";
       }
    </script>
  </body>
</html>
```

The value 1 is never assigned to the input text (id1).
It's like if the JavaScript code is not executed synchronously.

Does someone can help on this?