1.

What are the difference between alert() and confirm()?

Answer»

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.

Example

Display MESSAGE with alert() and confirm()

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



Discussion

No Comment Found