Dialog Boxes:
Javascript has three kinds of alert boxes.
Javascript has three kinds of alert boxes.
- Alert box
- Prompt box
- Confirm box
Alert Box:when an alert box is displayed to the user then user needs to click ok button to proceed.
EX:
Code:
OUTPUT:
Confirm Box:
A confirm box is often used if you want to verify the user to verify or accept something.
when a confirmation box pops up the user will have to click either ok or cancel button,
EX:
Code:
OUTPUT:
After Clicking the button
After Pressing OK button
After Pressing Cancel button
Prompt Box:
A prompt box is often used if you want the user to input a value before entering a page.
When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after entering an input value.
EX:
Code:
OUTPUT:
After pressing login button