0

How can I call a function inside an iframe?

In main.html I want to call function a in the following iframe.

...
<iframe src="/viewer/index.do?mapNo=20&amp;viewMode=ifrm">
<script>
function a() {
     console.log('hi');
</script>
</iframe>
...

I wonder how to call function a inside iframe when such code exists.

Best Regards!

ringhiosi
  • 73
  • 4
  • Does this answer your question? [How can I access iframe elements with Javascript?](https://stackoverflow.com/questions/1452871/how-can-i-access-iframe-elements-with-javascript) – Someone_who_likes_SE Nov 24 '21 at 04:10

0 Answers0