chasethemetal Posted June 19, 2012 Share Posted June 19, 2012 Hello! I have 2 pages, the parent document and mulitple iframes in that parent document. In the iFrames I am trying to target it's own class attribute... <iframe class="frame"></iframe><iframe class="frame"></iframe><iframe class="frame"></iframe> So inside each iframe I have a function and I am trying to clear its class! But I can't figure out how to target itself!!! So I do the function in the first <iframe> and it should look like this now <iframe></iframe><iframe class="frame"></iframe><iframe class="frame"></iframe> Any help would be appricieated thanks! Link to comment Share on other sites More sharing options...
justsomeguy Posted June 19, 2012 Share Posted June 19, 2012 The document inside the iframe doesn't have direct access to the iframe element in the parent document. You need to navigate through the DOM to the parent document's DOM and access the iframe object in that. I believe window.parent will give you a reference to the parent DOM. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now