父窗口中操作iframe:$(window.frames[iframechild].document) //假如iframe的id为iframechild
在子窗口中操作父窗口:$(window.parent.document)
接下来就可以继续获取iframe内的dom了。
获取iframe内的dom对象有两种方法
1 $(window.frames[iframechild].document).find(#child)
2 $(#child,window.frames[iframechild].document)
1.在父窗口中操作 选中iframe中的所有单选按钮
复制代码 代码如下:
$(window.frames[iframechild].document).find(input[@type='radio']).attr(checked,true);
2.在iframe中操作 选中父窗口中的所有单选按钮
复制代码 代码如下:
$(window.parent.document).find(input[@type='radio']).attr(checked,true);