Dialogs are messages that prevent the user from using the webpage until they respond to it. There are three types: alerts, confirms and prompts. Alerts provide just an OK button, confirms OK and Cancel, and with prompts you can enter values. JS Dialogs are not the best as they are not customisable, except for providing line breaks with \n, and prevent the user from doing other things. Good alternatives are Bootstrap modals.
See the below links for learning about dialogs and modals:
You can implement JS dialogs using the following code:
alert("text");//the user has to click OK to continue
var confirm = confirm("text");//this will equal true if the user clicked OK, false if the user clicked Cancel
var prompt = prompt("text")//this will equal the value of the entered text, if the user clicked Cancel, it will equal null
JS dialogs should not be used for interaction as much as Bootstrap modals.