Home >Web Front-end >JS Tutorial >jquery, js call iframe parent window and child window elements method arrangement_jquery
1. jquery gets the parent page element code from the iframe sub-page as follows:
$("#objid", parent.document)
2. jquery gets the elements of the iframe subpage on the parent page
The code is as follows:
$("#objid",document.frames('iframename').document)
3.js The code to obtain the parent page element in the iframe sub-page is as follows:
indow.parent.document.getElementByIdx_x("Element id");
4.js Get the iframe subpage element code from the parent page as follows:
window.frames["iframe_ID"].document.getElementByIdx_x("element id");
5. Call the parent class function in the subclass iframe:
window.parent.func();