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();