父页面使用jquery查找子网页中的元素如何写代码?

2025-05-18 08:37:46
推荐回答(1个)
回答1:

//子查父
$('#name', window.top.document).append("hello");
//父查子
$(function(){要等页页面加载完毕后才能找到iframe
$("#iframeID").contents().find("#name").append("hello");
});