输入banner图图片脚本导航/分类

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

一:利用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里传来的值";