You should also Read these articles:
- A prompt box in 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.
- If the user clicks “OK” the box returns the input value. If the user clicks “Cancel” the box returns null.
- Here the second argument “defaultValue” is optional. You can skip this argument.
The output of Prompt Box: