How to close window after iframe form submits

0

I have a blank page with an iframe that displays a form from an external domain outside my control. I’m trying to write a bit of Javascript/jQuery that will close the window after the form is submitted.

Here’s my code:

$('iframe input[type="submit"]').on('click', function () {
    window.close();
});

Nothing happens when I click the button though. What am I doing wrong?

Link: How to close window after iframe form submits
Source: Stack Jquery

Share.

About Author

Leave A Reply