# Handle Dialog Block

<figure><img src="https://742850480-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmtnl2J19CnNVA5fLFAPs%2Fuploads%2FvIWsZQWRUXcgRwI0rDGN%2FHandle%20Dialog1.jpg?alt=media&#x26;token=3247c6b6-2ed0-4b8d-910c-64c5c1852a03" alt=""><figcaption></figcaption></figure>

This block accepts or rejects a dialogue launched by a JS (alert, confirmation, prompt, or onbeforeunload). You must use this block prior to the dialog box appearing. For instance, when a dialogue box appears after clicking on an element.

<figure><img src="https://742850480-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmtnl2J19CnNVA5fLFAPs%2Fuploads%2FIB4lHibsakDgHkC3c8Pq%2FHandle%20Dialog.jpg?alt=media&#x26;token=27588cd8-f2f6-4cc1-bb3c-84f303f9ad59" alt=""><figcaption></figcaption></figure>

* **Accept dialog.** Accept or reject the dialog prompt.
* **Prompt text.** This is the text to enter into the dialog prompt before accepting. It is used only in a prompt dialog box.
