Tag:htmljavascript
Article From:https://segmentfault.com/q/1010000012142691
Question:

Can you tell when the iframe page is loaded on the parent page and then operate the DOM element of the iframe page?

Answer 0:

js

//Call subpage methodDocument.getElementById ("sub page ID").ContentWindow.childtest ();/ / control subpage elementDocument.getElementByID ("sub page ID").ContentWindow.document.getElementById ("theme-src").Href = href;

jq

$('#iframe').contents().find("#abc").val("aaa");   

Leave a Reply

Your email address will not be published. Required fields are marked *