当前位置:Gxlcms > html代码 > iframe提取与改变父页面元素_html/css_WEB-ITnose

iframe提取与改变父页面元素_html/css_WEB-ITnose

时间:2021-07-01 10:21:17 帮助过:15人阅读

一:利用jquery方法获得


1:取值

$(window.parent.document).find("#second_navigator").html();


2:改变父页面元素

$(window.parent.document).find("#second_navigator").html(“我是从iframe里传来的值”);


二:javaScript方法


1:取值

window.parent.document.getElementById("second_navigator").innerHTML;


2:改变父页面元素

window.parent.document.getElementById("second_navigator").innerHTML="我是从iframe里传来的值";

人气教程排行