Im trying to access a string in a textbox which Is located within an iframe on the parent document but the iframe is linked to a source html file.
I know of
But because its within an iframe which is getting its data from another html file Im having difficulty.
The following one-liner reaches from a child window up to the parent, and in to an iframe to retrieve the content.
"<p>I am the iframe.</p>"
Breaking it down:
var parentDoc = window.opener.document;
var iframeDoc = parentDoc.getElementsByTagName('iframe').contentDocument;
var iframeContent = iframeDoc.getElementById('content').innerHTML;