最佳答案
如果它来自另一个站点/域,则无法执行此操作,它必须位于同一域中。要访问同一域中 iframe 中的元素,您可以使用 frames property窗口对象的
let iframeBtn = window.frames['yourIFrame'].document.getElementById('buttonId');
//code to trigger the button inside the iframe
关于javascript - 如何触发其他网站的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54068195/