Dialogue Boxes

alert()

Very simply displays a popup alert box, with a single OK button:

alert(“Message goes here!”);

 

 

prompt()

Displays a prompt box, requesting text to be entered, which can be assigned to a variable:

 

 

confirm()

Displays popup confirmation box with OK and cancel buttons:

 

 

To get a new line in a dialogue box use the escaped \n sequence.

Leave a Reply