The alert() method is used to display an alert box with a message and an OK button. It is done in order to send information to the user. By doing this, we take the focus away from the current window and force the user to read the message.
Its syntax is:- alert(message)
|message||Optional. The text we want to display in the alert box.|