why does alert() break code execution?

后端 未结 4 899
北荒
北荒 2020-12-11 02:38

When we use alert(), some times the code breaks.

For example:

HTML:

Hi

Javascript:

4条回答
  •  情话喂你
    2020-12-11 02:57

    alert opens a model dialogue. When it is open, you can't interact with any part of the page except the alert itself.

    Since you can't interact with the page, the second half of the double click can't reach the span, so the double click event won't fire.

提交回复
热议问题