Yellowdie
Yellowdie

Reputation: 13

Clicking OK in a prompt

I know how to create alerts and confirm boxes, but what I cannot find out how to do is to do the actual clicking of OK. I have a page that pops up a confirm box. I want to click OK using a Java Script add-on. Basically, I want my code to click a link on the page, then click ok when prompted. Is that possible?

Upvotes: 1

Views: 967

Answers (1)

tskuzzy
tskuzzy

Reputation: 36446

That's not possible with a browser pop-up.

However if it's a modal dialog that sits within the DOM of the page, then you can trigger a JavaScript event to close it. An example of such a dialog is jQuery's dialog.

Upvotes: 3

Related Questions