In Chrome, the following code does not display the <h1>Hello</h1>
until after the alert
is shown and the user clicks ok. However, in Firefox the expected sequence happens, <h1>Hello</h1>
is displayed and then the alert appears.
<h1>Hello</h1>
<script>
alert('Hello is displayed after this alert')
</script>
I'm curious why Hello
shows up after the alert is closed in Chrome. Is that what's supposed to happen? Is the HTML/JavaScript spec simply unclear and Chrome just never bothered to make this intuitive? Is it a bug in Chrome?