Which window method generates a dialog box that displays whatever text you…

2018

Which window method generates a dialog box that displays whatever text you pass as a parameter in JavaScript?

  1. A.

    Display()

  2. B.

    Show()

  3. C.

    Alert()

  4. D.

    Perform()

Attempted by 88 students.

Show answer & explanation

Correct answer: C

The alert method displays a dialog box with a specified message and an OK button. Options like display, show, or perform are not valid JavaScript window methods for generating standard dialog boxes. Therefore, alert is the correct function to use when passing text as a parameter for user notification.

Explore the full course: Up Lt Grade Assistant Teacher 2025