Here's a button which calls the alert() function. The result of the alert is displayed in another alert box (and its always "undefined").
Here's a button which calls the confirm() function. The result of the confirm is displayed in an alert box ("true" if the user presses OK, "false" if the user presses Cancel).
Here's a button which calls the prompt() function. The result of the prompt is displayed in an alert box ("false" if the user presses Cancel, or if the user presses OK, the string the user has typed in (or the empty string if the user types nothing and presses OK)).
Note the parameter string for each of the alert() confirm() and prompt() contain one or more \n which act as a line break character, in the same way as <br> does in HTML (alert boxes display text, not HTML).