版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Lemostic/article/details/81194974
- 页面层次结构如下:
————- mainPage(mainPage有两个iframe:iframe1和iframe2)
————————iframe1
————————iframe2(iframe2中又嵌套一个iframe:iframe2_1)
———————————–iframe2_1
现在,要在iframe2_1中操作mainPage页面中的iframe1下面的某个元素,可以按照如下方式操作:
var selector = $(top.parent.iframe1).contents().find("#selectorId");
亲测可用,不知道大家有没有遇到过同样的问题。