window.onload=function(){// 确保jquery 可用
//先获取iframe的document对象,在最外层window中加载的js默认会使用最外层的document对象,直接使用$("iframe.子元素")大概率取不到元素
	let iframeDocument=$("iframe[name='iframeName']")[0].contentWindow.document; 
	let targetDom=$(iframeDocument).find('子元素');
}

更多推荐

使用jquery准确获取iframe中的元素