Jquery-获取iframe中的dom对象

父窗口中操作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"); 
原文地址:https://www.cnblogs.com/hwaggLee/p/4598434.html