可不可以在父页面判断iframe页面什么时候加载完成,然后操作iframe页面的dom元素?
1 回答
![?](http://img1.sycdn.imooc.com/545863cd0001b72a02200220-100-100.jpg)
狐的传说
TA贡献1804条经验 获得超3个赞
js
//调用子页面方法
document.getElementById("子页面id").contentWindow.childtest();
//控制子页面元素
document.getElementById("子页面id").contentWindow.document.getElementById("theme-src").href = href;
jq
$('#iframe').contents().find("#abc").val("aaa");
添加回答
举报
0/150
提交
取消