hwaggLee

父窗口中操作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"); 

 

分类:

技术点:

相关文章:

  • 2021-11-28
  • 2021-11-28
  • 2021-03-30
  • 2021-09-28
  • 2021-05-30
  • 2022-12-23
猜你喜欢
  • 2021-11-28
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案