+ 2

What happens if we use both prompt and alert boxes at a time?

I just want to know about the question and please help me.

11th Feb 2017, 1:22 PM
Harsh007Sharma
Harsh007Sharma - avatar
4 Réponses
+ 9
Code stops and awaits input, then continues……
11th Feb 2017, 1:41 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 3
you'll have both windows that will open in the order written in your code
11th Feb 2017, 1:35 PM
Peter Kellighan
Peter Kellighan - avatar
+ 2
What better way than to try it out yourself. You know, you can test JavaScript right in your browser. :P
11th Feb 2017, 1:55 PM
John Afolayan
+ 2
Nothing will happens, as alert/prompt/confirm dialog are modals ones, what mean that when called, script is stopped, waiting for the returned value of the function, which occurs only when the dialog is closed by user. ALL the active script is stopped: you cannot guess that sending some setInterval or setTimeout will success to call a second dialog box, but it will never occurs ( all the js script(s) of a page is running in one unique thread ) ...
14th Feb 2017, 9:22 AM
visph
visph - avatar