I have a web page that brings an Iframe that contains a form with its submit button, what I am looking for is to make a javascript code (jquery is not valid) that when the button inside the Iframe is pressed, I can perform a JS function.
I'm in charge of the code, but I need to know how my javascript or my web page, browser... detects that the button inside an Iframe has been pressed.
PS: I don't create the Iframe or that button, otherwise I would put an onclick or something like that, but no.
All the best.
To get from the parent a
iframe
use:With this you get the
iframe
and you can access all its functions, with:You can launch an event from the parent.
Edition
I also leave you an example function with what I use in my project to capture multiples
iframes
and execute a common function.Parent part:
Children Part: