Which JavaScript method shows a modal alert message to the user?

Prepare for the uCertify CIW Advanced HTML5 and CSS3 Specialist Exam. Dive into essential topics with flashcards and multiple-choice questions. Enhance your understanding with hints and explanations for each question. Pass your exam confidently!

Multiple Choice

Which JavaScript method shows a modal alert message to the user?

Displaying a simple, blocking message to the user is done with the alert function. When you call alert("message"), the browser shows a modal dialog with the message and an OK button, and the user must click OK to dismiss it and continue interacting with the page. It’s a straightforward way to grab attention with just a message and no input.

Other options serve different purposes: prompt presents a dialog that includes a text input for the user to type something, then returns the entered value (or null if canceled); confirm shows a dialog with OK and Cancel and returns true or false based on the user’s choice; log (often console.log) outputs information to the browser console and does not display a dialog at all.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy