Dialog Windows

This example demonstrates the 3 types of Dialog Windows JavaScript provides.

Prompt Dialog Window - returns string of characters, or null value if you hit cancel.

Confirm Dialog Window - returns a Boolean value.

Alert Dialog Window - does not return a value.

The three types of dialog windows you just saw are summarized below. Reload this page to experiment with them again.
 string   ← prompt('Collects Data from User.')                Returns a string or null value.
 boolean  ← confirm('Requires User to Make a Decision.')      Returns a boolean value.
             alert('Requires User to Acknowledge the Alert.')  Does not return a value.
These windows provide all the standard needs for dialog with the user: collecting data, forcing a decision, and forcing an acknowledgement.

Unfortunately, you can't use HTML/CSS to format these windows and make them more fancy.
They might even look slightly different in different browsers, but the functionality will be the same.
More fancy dialog boxes can be created using advanced JavaScript/CSS libraries such as JQuery UI and Bootstrap, but that is well beyond the scope of this course.