Home  >  Article  >  Web Front-end  >  JQUERY Example of obtaining objects in IFrame and obtaining objects in its parent window_jquery

JQUERY Example of obtaining objects in IFrame and obtaining objects in its parent window_jquery

WBOY
WBOYOriginal
2016-05-16 17:25:161175browse

In web development, iframes are often used. It is inevitable that you need to use elements in the iframe in the parent window, or use elements in the parent window in the iframe
Get elements in the iframe in the parent window

Format: $("#iframe's ID").contents().find("#iframe's control ID").click();
Example: $("#ifm").contents ().find("#btnOk").click();

Get the element of the parent window in the iframe
Format: $('#Element ID in the parent window', parent.document) .click();
Example: $('#btnOk', parent.document).click();

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