alert in javascript

alert in javascript

alert is an basic method in javascript.

This is used to display alert box with ok button.

Example 1

Try Yourself

It will block the next line execution until user press the ok button.

In the below example, it does not execute the document.write("New Text"); until ok button is pressed.

Example 2

Try Yourself