87,996
社区成员
发帖
与我相关
我的任务
分享你搜搜window.postMessage这个方法试试

window.onload = function(){
var test = document.getElementById(‘iframe的id’).contentWindow.document.getElementById(‘iframe里要获取的元素的id’);
console.log(test);
test.style.display = “none”;
}
// 域名不同的情况下,会存在跨域,需要在嵌套的网站页面中设置允许访问的域名