Multiple choice technology web technology

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

  1. alert("Hello World")

  2. alertBox="Hello World"

  3. alertBox("Hello World")

  4. msgBox("Hello World")

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

To display text in an alert box, use alert("Hello World"). The alert() function is a built-in JavaScript method that shows a popup dialog. alertBox is not a valid JavaScript object or function.