How do you write "Hello World" in an alert box?
-
alert("Hello World");
-
msg("Hello World");
-
alertBox("Hello World");
-
msgBox("Hello World");
A
Correct answer
Explanation
In JavaScript, the alert() method is the standard built-in function used to display an alert box with a specified message and an OK button. The other options like msg() or msgBox() are invalid standard functions.