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\';
al
Yes, it is synchronous, because this works (go ahead, type it in your console):
document.body.innerHTML = 'text';
alert(document.body.innerHTML);// you will see a 'text' alert
The reason you see the alert before you see the page changing is that the browser rendering takes more time and isn't as fast as your javascript executing line by line.