Home > Web Front-end > JS Tutorial > How to get parent page elements from iframe subpage_jquery

How to get parent page elements from iframe subpage_jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:17:26
Original
978 people have browsed it

Get the parent page element

in the iframe child page. The code is as follows:

Copy the code and the code is as follows:

$.('#objld', parent.document);

Get the elements of the iframe subpage in the parent page
The code is as follows:
Copy code The code is as follows:

$("#objid", document.iframes('iframe').document)

or
Copy code The code is as follows:

$(document. getElementById('iframeId').contentWindow.document.body).html() $(document.getElementById('iframeId').contentWindow.document.body).html()

Display in iframe The content of the body element
Copy code The code is as follows:

$("#testId", document .frames("iframename").document).html()
Related labels:
Statement of this Website
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
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template