Buttons appearing in consequential order, third button popups up after window is clos

button and get a url to a webpage and the second button appears.

How would I program the third button to appear when the webpage is closed or onunloaded, so I would have to write something.

The buttons appear in the file that I downloaded in consequential order appearing when one button is pressed.

How would I do this? I want the third button to go to another url. But I want the second button, which I can write text next to the button to keep clicking until you reach the third window of the first button.

And then the third button to popup when the user closes the second buttons window . And I am going to put a url so they can get their bonus icon.