There are three message boxes: alert, confirm, and prompt.
Let’s look at the first one:
<body> <script> window.alert("Welcome to my site!") </script> </body>
You can put whatever you want inside the quotation marks.
An example for confirm box:
window.confirm("Are you sure you want to quit?")
Prompt box is used to allow a user to enter something according the promotion:
window.prompt("please enter user name")
In all our examples above, we wrote the box methods as window.alert(). Actually, we could simply write the following instead as:
alert() confirm() prompt()