Operate the iframe in the parent window: window.frames["iframeChild"].document //If the id of the iframe is iframeChild
Operate the parent window in the child window: window.parent.document
Then , if we want to use jquery, how do we use jquery to get the iframe? Here's how to collect it.
The object to obtain the page is actually adding the jquery selector outside the dom method:
Operation iframe in the parent window: $(window.frames["iframeChild"].document) //If The id of the iframe is iframeChild
Operate the parent window in the child window: $(window.parent.document)
Then you can continue to obtain the dom in the iframe.
There are two ways to get the DOM object in the iframe
1 $(window.frames["iframeChild"].document).find("#child")
2 $("#child",window.frames["iframeChild"].document)
1. Select all radio buttons in the IFRAME in the parent window
$(window.frames[" iframeChild"].document).find("input[@type='radio']").attr("checked","true");
2. Select all radio options in the parent window in IFRAME Button
$(window.parent.document).find("input[@type='radio']").attr("checked","true");