Home  >  Article  >  Web Front-end  >  iframe extraction and changing parent page elements_html/css_WEB-ITnose

iframe extraction and changing parent page elements_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:53:271351browse

1: Use the jquery method to obtain


1: Get the value

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


2: Change the parent page element

$(window.parent. document).find("#second_navigator").html("I am passing the value from the iframe");


Two: javaScript Method


1: Value

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


2: Change the parent page element

window.parent.document.getElementById("second_navigator").innerHTML="I passed the value from the iframe" ;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn