我有一个 iframe。我想访问 iframe 内部的表格。我想从 iframe 的父窗口访问它。我写的JS就像
Document.getElementById("table Id");
但是结果为空。获取的流程是怎样的? 谢谢
最佳答案
x=document.getElementById("iFrameId");
x.contentDocument.getElementById("tableId");
如果你可以使用 jQuery,我想它可以跨浏览器工作
$("#iFrameId").contents().find("#tableId")
关于javascript - 如何从父窗口访问 iframe 中存在的元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8676478/