Multiple choice technology web technology

How do you write "Hello World" in an alert box?

  1. msgBox("Hello World")

  2. alertBox("Hello World")

  3. alert("Hello World")

  4. alertBox="Hello World"

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

alert() is the built-in JavaScript function that displays a modal dialog box with a message and an OK button. Option A uses msgBox() which doesn't exist in standard JavaScript, option B uses alertBox() which is also not a standard function, and option D attempts to assign a string to a non-existent alertBox property.