-
Reference an Element in the Main Document from an IFRAME
If I have a script that runs within an IFRAME that will change an element on the page which contains the IFRAME, what syntax would I use to reference the element on the main page?
Obviously document.getElementById("headerDiv").innerHTML = "Hello World" would change the DIV if the script is executed via the main document, however what if the script is executed via a document contained within an IFRAME?
-
-
onclick (onload, whatever)='parent.document.getElementById("headerDiv").innerHTML = "Hello World"'
Arie Molendijk.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks