window.onload=function(){// 确保jquery 可用
//先获取iframe的document对象,在最外层window中加载的js默认会使用最外层的document对象,直接使用$("iframe.子元素")大概率取不到元素
let iframeDocument=$("iframe[name='iframeName']")[0].contentWindow.document;
let targetDom=$(iframeDocument).find('子元素');
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)