场景:
我有一个加载超过 4 个 iframe 的表单页面。我无法控制此 iframe,因为它是由其他网站(API)生成的;
Iframe 有一个表单和输入。
在我的代码中
<form>
<div class="fields">
<!--onload iframe will populate this area-->
</div>
<div class="fields">
<!--onload iframe will populate this area-->
</div>
<div class="fields">
<!--onload iframe will populate this area-->
</div> </form>
在页面加载时发生这种情况
<form>
<div class="fields">
<iframe src="" frameborder="0">
<html>
<body>
<form action="">
<input type="text">
</form>
</body>
</html>
</iframe>
</div>
<div class="fields">
<iframe src="" frameborder="0">
<html>
<body>
<form action="">
<input type="text">
</form>
</body>
</html>
</iframe>
</div>
<div class="fields">
<iframe src="" frameborder="0">
<html>
<body>
<form action="">
<input type="text">
</form>
</body>
</html>
</iframe>
</div></form>
在 chrome 中:填写表格时,chrome 中的选项卡没有任何问题。例如,单击第一个输入,然后按 Tab 键进行下一个输入,直到您完成整个表格的填写。
但在 Firefox Mozilla 中:
单击第一个输入,然后 Tab 两次以获取下一个输入。它不直接选择输入字段,它似乎适用于每个元素。
有没有脚本可以防止这种情况?像chrome中的正常行为一样?
我已经检查了这个Tabindex 以跳过 iframe 但不是里面的内容, 但我的情况不同