I hope I won't make a fool of myself but I'm trying to understand what is happening in those two lines of code:

```
document.body.innerHTML = 'something';
alert('something else');

```

What I am observing is that alert shows before HTML has been updated (or maybe it has but the page hasn't been refreshed/repainted/whatever)

Checkout this [codepen](http://codepen.io/anon/pen/NpzqQJ) to see what I mean.

Please note that even putting `alert` in `setTimeout(..., 0)` does not help. Looks like it takes more event loops for `innerHTML` to actually update page. 

EDIT:

I forgot to mention I am using Chrome and did not check other browsers. Looks like it's only visible in Chrome. Nevertheless I am still interested why is that happening.