Home » Jquery » javascript – Attach jquery onclick event to element in iframe where element is not yet rendered

javascript – Attach jquery onclick event to element in iframe where element is not yet rendered

Posted by: admin February 22, 2020 Leave a comment

Questions:

I have iframe on my web page. Iframe contains a wizard type form and I need to know when the user finished the wizard in order to continue with the main page. The last step of the wizard will contain the submit button.

How I can attach to that button on the main page? At the moment of rendering iframe buttons are not visible.

I have tried following with no luck:

$('#iframe_id').on('click','#submit_wizard', function(){
        alert('wizard form submitted, time to continue');
    }) 
How to&Answer: