Let's try to see all the three examples below
When an alert box pops up, user have to click "OK" button to proceed.
Click the button to display an alert box:
When a confirm box pops up, user can click "OK" or "Cancel" to proceed.
Box returns true, if the user clicks "OK" and box returns false if user clicks "Cancel"
Click the button to display an confirm box:When a prompt box pops up, user can click "OK" or "Cancel" to proceed
If the user clicks "OK" after entering the input value, it will return value as Output. If the user clicks "Cancel" the box returns nothing.
Click below button for prompt box.