The example in this article describes the method of calling functions in iframe frame pages in Javscript. This calling method is actually very simple. With this method, we can transfer or modify values between iframes. The operation is very simple. . Share it with everyone for your reference. The specific implementation method is as follows:
Access functions inside iframe:
Examples are as follows:
1.html
Clicking the test button in 1.htm will invalidate the mybutton button in 2.htm (iframe page). It's that simple, haha. If you want to call the JS function in 2.htm, write this:
Example:
Suppose there are 2 pages, index.html and inner.html. There is an iframe in index.html, and the src of this iframe points to inner.html.
What we have to do now is:
1. Call a js method on inner.html in index.html
2. Call a js method on index.html in inner.html
The implementation code is as follows:
index.html:
inner.html:
I hope this article will be helpful to everyone’s web programming based on JavaScript.