父窗口获取iframe子窗口window对象和document对象的方法

var iframe=document.getElementById("xxx");//父窗口获取iframe子窗口对象

var iframew=iframe.contentWindow;//iframe窗口的window对象

var iframed=iframew.document;//iframe窗口的document对象

var iframed2=iframe.contentDocument;//DOM2也支持直接获取document对象

原文地址:https://www.cnblogs.com/dabaixiong/p/14422598.html