> For the complete documentation index, see [llms.txt](https://docs.dogq.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dogq.io/documentation/interacting-with-js-popups.md).

# Interacting with JS Popups

Some sites implement default [Javascript popups](https://www.w3schools.com/js/js_popup.asp) to confirm certain actions or notify users about something important. These popup modals are built into Javascript and when on-screen they prevent user from interacting with the site until their condition is fulfilled. Javascript has three types of popup boxes: Alert box, Confirm box and Prompt box. The reserved word for these dialog boxes is `JavascriptPopup`.

### Alert popups

Alert messages are usually implemented to make sure users are notified about something important. To continue using the site one would normally need to click OK, however with DogQ you don't need to do anything - the message will be accepted automatically.&#x20;

<figure><img src="/files/GakJBIhHMFnlsivLP9Wl" alt=""><figcaption></figcaption></figure>

### Confirm popups

Conventionally, confirm dialog windows serve as safeguards when users perform certain signifact actions on a site, like deletion or changing of account information. To interact with a Confirm popup:&#x20;

1. find element: `JavascriptPopup`
2. find element: OK / Cancel (depending on whether you want to accept or cancel the message)
3. click element

{% hint style="info" %}
Note that two **Find element** steps in a row here is by design. The first one is to signal to DogQ that it's the Javascript popup that you want to interact with and not the main page.
{% endhint %}

<figure><img src="/files/qtZvB9H4xf5ao2pgR7vI" alt=""><figcaption></figcaption></figure>

### Prompt popups

Prompt popups can be used for numerous purposes. With this type of popups, users are asked to input a value before continuing. The process is almost the same as with the confirm popups, but instead of Find element you need to use the Find input - Type into combination:

1. find input: `JavascriptPopup`
2. type into: your answer
3. find element: OK / Cancel (depending on whether you want continue or cancel the prompt)
4. click element

<figure><img src="/files/WVSQ9oaF6MiJGGNjF7bZ" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dogq.io/documentation/interacting-with-js-popups.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
