Multiple choice

Which JS command tells a browser to open a dialog box with a message?

  1. console.log()

  2. alert ()

  3. document.write

  4. script ( )

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

The alert() function is the standard JavaScript method to display a modal dialog box with a message.