Alert()- it is a pop up that is intended for the user to click the OK button and vanish once you click.

Confirm ()- it is a wider choice and gives 2 options to the user to choose. It is basically like an if-else statement.



Display message with alert() and confirm()

alert('Are you sure to delete this item?');
confirm("Are you sure to delete this item?");

Suggest An Answer

No suggestions Available!