Multiple choice javascript

You work on a JavaScript project. How do you prompt users with messages and at the same time requesting user inputs?

  1. Alert()

  2. Display()

  3. Prompt()

  4. Confirm()

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

The prompt() method displays a dialog box with a message and accepts user input, returning that input as a string. alert() only displays a message, confirm() shows an OK/Cancel dialog, and display() is not a standard JavaScript method.