“Используйте JavaScript для управления элементами iframe” Ответ

атрибуты iframe

<iframe width="560" height="315" src="https://www.youtube.com/embed/owsfdh4gxyc" frameborder="0" allowfullscreen></iframe>
Kamyab Rouhifar

Используйте JavaScript для управления элементами iframe

<iframe id="myIFrame" src="thispage.html"
    width="100%" height="600"
    frameBorder="2">
</iframe>

// Get the iframe
const iFrame = document.getElementById('myIFrame');

// Let's say that you want to access a button with the ID `'myButton'`,
// you can access via the following code:
const buttonInIFrame = iFrame.contentWindow.document.getElementById('myButton');

// If you need to call a function in the iframe, you can call it as follows:
iFrame.contentWindow.yourFunction();
Idaho Potato

Ответы похожие на “Используйте JavaScript для управления элементами iframe”

Вопросы похожие на “Используйте JavaScript для управления элементами iframe”

Больше похожих ответов на “Используйте JavaScript для управления элементами iframe” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования