【发布时间】:2021-11-09 19:26:48
【问题描述】:
我有一个 iframe,并且在 iframe 的网站内,有一个按钮,我希望在 iframe 加载时自动单击该按钮。这是 HTML 代码。
<div class="buttonnext action-button-container">
<button type="button" id="nextBtn" class="action-button red0">
<span id="nextBtn-final">
CLICK TO PROCEED
</span>
</button>
</div>
【问题讨论】:
-
iframe 是否与主页在同一个域中?如果没有,您将无法访问它。
-
这能回答你的问题吗? iFrame onload JavaScript event(假设按钮在 iframe 内,如标题所示)
-
如果按钮不在 iframe 中,您可以使用 iunfixit 提到的 iframe onload 向主窗口发送事件。 stackoverflow.com/questions/9153445/…
标签: javascript html jquery css iframe