let win =document.getElementsByTagName('iframe')[0].contentWindow;
let doc = win.document;
let html = doc.getElementsByTagName('html')[0];
ht.innerHTML = `你设置的内容`
本文介绍了一种通过JavaScript操作页面中iframe元素的方法,展示了如何获取iframe内部的document对象,并修改其html内容。
let win =document.getElementsByTagName('iframe')[0].contentWindow;
let doc = win.document;
let html = doc.getElementsByTagName('html')[0];
ht.innerHTML = `你设置的内容`
762

被折叠的 条评论
为什么被折叠?