1<iframe width="560" height="315" src="https://www.youtube.com/embed/owsfdh4gxyc" frameborder="0" allowfullscreen></iframe>
1<iframe id="myIFrame" src="thispage.html"
2 width="100%" height="600"
3 frameBorder="2">
4</iframe>
5
6// Get the iframe
7const iFrame = document.getElementById('myIFrame');
8
9// Let's say that you want to access a button with the ID `'myButton'`,
10// you can access via the following code:
11const buttonInIFrame = iFrame.contentWindow.document.getElementById('myButton');
12
13// If you need to call a function in the iframe, you can call it as follows:
14iFrame.contentWindow.yourFunction();