0

Hello I have iframe and in the iframe i need to get element of the parent window. How can i do it ?

 index.html

child.html get parent element by id

asked May 7, 2016 at 13:17
1

1 Answer 1

1

If you have var myVar in the parent window, you can access it from the child window with window.parent.myVar.

Note: this will only work if both child and parent are on the same domain.

See here for more info.

answered May 7, 2016 at 13:22
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.