'Trigger Click on Dynamic/ Relative Parent Frame Modal Button from within an Iframe

On this page I want to trigger a click on the home button from within the iframe, by both a click trigger and timeout trigger.

The home button can be found by navigating into either category enter image description here

Then either form. enter image description here

The iframe displays a fake form submission button**, when clicked it goes to a success page. The home button is at the top right. enter image description here

The trigger button is the green button on the success page.

enter image description here

The home button on each form is named dynamically relative to each form being viewed ( #successhome1, #successhome2, #successhome3, etc. ) and contains the functions to close it's relative modal (*and not mess with other modals).

How can I implement Javascript/Jquery (sorry for my ignorance if either is not appropriate) so that a click on the green button within the iframe, or a timeout of 3 seconds after page load, causes the relative parent frame home button to be clicked?

*NB:The original version of my home button had non-dynamic IDs, but this causes the toggle of shared ID/class elements - thus displaying hidden modals whilst hiding the active modal.

** I'm using a fake form submission button, as when live, the form submission will be handled cross-domain, limiting what can be achieved between parent frame and iframe.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source